oTAMAKOo / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

ProxyConfiguration in SpreadsheetsService / ListFeed Insert #486

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. We are trying to use SpreadsheetService / Listfeed.Insert behind Proxy, this 
doesnt work. It freezes on "myService.Query(lQuery);".

Se code below with the .NET code:

SpreadsheetsService myService = new SpreadsheetsService("Test");
myService.setUserCredentials("UserName", "Password");

GDataRequestFactory f = (GDataRequestFactory)myService.RequestFactory;
WebProxy myProxy = new WebProxy();
myProxy.BypassProxyOnLocal = true;
myProxy.Address = new Uri("http://proxy:8888");
myProxy.Credentials = CredentialCache.DefaultCredentials;
myProxy.UseDefaultCredentials = true;
f.Proxy = myProxy;

ListQuery lQuery = new ListQuery("...");
ListFeed lFeed = myService.Query(lQuery);

ListEntry newRow = new ListEntry();
newRow.Elements.Add(new ListEntry.Custom { LocalName = "test", Value = "" });

lFeed.Insert(newRow);

What is the expected output? What do you see instead?
Can't get response from google API. If we set the defaultProxy in web.config to 
"http://proxy:8888", the same code works, so this is a Proxy problem. 
Unfortently we cant have this setting in our real test envirments, so we have 
to find a solution for this. Can you specify the proxy-settings in some other 
way? I know with AdWordsApi you can have a <AdWordsApi> tag in web.config with 
ProxyServer settings.

Original issue reported on code.google.com by forv.rek...@posten.se on 9 Mar 2011 at 1:25

GoogleCodeExporter commented 8 years ago
Can you capture traffic to understand what happens under the hood?
Does it ever timeout?

Original comment by ccherub...@google.com on 9 Mar 2011 at 1:29

GoogleCodeExporter commented 8 years ago
It times out with the exception: {"Execution of request failed: 
https://spreadsheets.google.com/feeds/list/key../od../private/full"}

and innerException: The remote name could not be resolved: 'www.google.com'.

So it seems like its never reaching the proxyserver, as I said before, if we 
specify the proxyserver for all requests in web.config, it works. So maybe the 
lFeed.Insert() doesnt use thre proxy settings specified in GDataRequestFactory?

Original comment by forv.rek...@posten.se on 9 Mar 2011 at 2:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Maybe a update will help someone else with this. I never solved it with the 
GData API, it never uses the proxy specified in GDataRequestFactory.

I ended up creating a System.Net.WebRequest POST with XML instead, and specifiy 
proxy on the WebRequest - works without any trouble at all.

Original comment by forv.rek...@posten.se on 16 Mar 2011 at 1:18

GoogleCodeExporter commented 8 years ago
Thanks for your help.

Are you using the latest version of the library code
Revision 1073 added a fix for the proxy issue:

http://code.google.com/p/google-gdata/source/detail?r=1073

Original comment by ccherub...@google.com on 16 Mar 2011 at 2:21

GoogleCodeExporter commented 8 years ago

Original comment by ccherub...@google.com on 25 Mar 2011 at 11:14