Long notes: InvalidOperationException

Developer
Mar 2, 2009 at 10:14 PM
Hi,

When synchronizing large TaskNotes (8000+ characters), I get an InvalidOperationException from System.Net.HttpWebRequest.set_Proxy, see below.
The exception occurs on this line:
   req.Proxy = Proxy;
I don't understand why setting a null proxy value should fail in case of a large variables length. But anyway, i'm not using the Proxy value yet, so the problem is solved in my case by not setting a proxy if there is no proxy:
  if (Proxy != null)     req.Proxy = Proxy;
But this probably still fails in case of a not null Proxy value.

The exception is unfortunately translated by the .NET framework, but is something like "Unable to complete operation after the request has been made":
System.InvalidOperationException: Deze bewerking kan niet worden uitgevoerd nadat de aanvraag is ingediend.   bij System.Net.HttpWebRequest.set_Proxy(IWebProxy value)   bij IronCow.Rest.RestClient.GetRawResponse(String url, String variables) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\Rest\RestClient.cs:regel 728   bij IronCow.Rest.RestClient.GetResponse(String method, NameValueCollection parameters, Boolean throwOnError) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\Rest\RestClient.cs:regel 684   bij IronCow.Rtm.GetResponse(String method, NameValueCollection parameters, Boolean throwOnError) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\Rtm.cs:regel 480   bij IronCow.RestRequest.Execute(Rtm rtm) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\RestRequest.cs:regel 32   bij IronCow.Rtm.ExecuteRequest(Request request) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\Rtm.cs:regel 450   bij IronCow.SynchronizedTaskCollection`1.Add(T item) in e:\LABWorks\CodingStuff\CodePlex\IronCow\trunk\IronCow\SynchronizedTaskCollection.cs:regel 121   bij GTD.RTM.SyncWithRtmForm.copyGtdToRtm(AbstractGTDItem lItem, Task lTask) in D:\Projecten\GTD.NET\WindowsXP\GTD.RTM\SyncWithRtmForm.vb:regel 168   bij GTD.RTM.SyncWithRtmForm.syncItem(TaskList tasklist, AbstractGTDItem lItem) in D:\Projecten\GTD.NET\WindowsXP\GTD.RTM\SyncWithRtmForm.vb:regel 155   bij GTD.RTM.SyncWithRtmForm.syncList(IList`1 list, TaskList tasklist) in D:\Projecten\GTD.NET\WindowsXP\GTD.RTM\SyncWithRtmForm.vb:regel 124
Coordinator
Mar 3, 2009 at 11:20 PM
Interesting... I'll look into it, thanks.