Hello,
I have problems setting proxy. I use .NET Client Library.
I'm working on a new version of GDocBackup and I'd like to support
environment where connections must go through proxy servers. All works
fine if download Document or Presentations but I get errors if I try
to download Spreadsheets.
The first step works fine:
GDataCredentials credentials = new GDataCredentials(_userName,
_password);
RequestSettings settings = new RequestSettings("GDocBackup",
credentials);
DocumentsRequest request = new DocumentsRequest(settings);
GDataRequestFactory x= request.Service.RequestFactory as
GDataRequestFactory;
x.Proxy = new WebProxy(); // ... or another proxy.
Feed<Document> feed = request.GetEverything();
List<Document> _docs = new List<Document>();
foreach (Document entry in feed.Entries)
_docs.Add(entry);
Second step: I download docs (the real code is more complex):
foreach (Document doc in _docs)
{
if (... skip folder and pdf...)
{
Stream stream = request.Download(doc,
Document.DownloadType.pdf);
using (FileStream outFile = new FileStream("out.pdf",
FileMode.Create, FileAccess.Write))
{.. save stream to local disk...}
}
}
I get an exception at line Stream stream = request.Download(doc,
Document.DownloadType.pdf);
I get the error only if I'm downloading a spreadsheet.
FYI the error is a proxy required authentication 407. But the problem
is not the exception. I try to explain.
I looked at the source code of the NET Lib and if I download a doc,
the lib uses the proxy I set. And I get no error.
If I download a spreadsheet, the lib use the "default" proxy and I get
the error.
So, why the lib use my proxy with doc and another proxy with
spreadsheets?
Fabrizio
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Docs Data APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---