Hello Russell,

There is a hard limit on the number of operations that can be sent through
a batch request. We usually advise developers to limit the number of
operations to 50-100 per requests:

http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#batch

That should be the reason why you are seeing this exception.
Also, is there any reasons you need to delete so much events?

Best,
Alain

On Mon, Oct 31, 2011 at 9:43 AM, Russell Reid
<[email protected]>wrote:

> I am still getting the exception.  I have tried it on two computers and
> have restarted both several times.  I have isolated the issue to the line
> that publishes the delete feed back to the calendar.  The delete feed
> appears to have all of the correct info in it.  Here is the exception
> detail (scrubbed of identifying info):  There is a request entity too large
> response from the server.  The current feed has 2011 items in it.
>
> Google.GData.Client.GDataRequestException was unhandled
>   Message=Execution of request failed:
> https://www.google.com/calendar/feeds/[email protected]/private/full/batch
>   Source=Google.GData.Client
>   ResponseString=<HTML>
> <HEAD>
> <TITLE>Request Entity Too Large</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Request Entity Too Large</H1>
> <H2>Error 413</H2>
> </BODY>
> </HTML>
>
>   StackTrace:
>        at Google.GData.Client.GDataRequest.Execute()
>        at Google.GData.Client.GDataGAuthRequest.Execute(Int32 retryCounter)
>        at Google.GData.Client.GDataGAuthRequest.Execute()
>        at Google.GData.Client.Service.EntrySend(Uri feedUri, AtomBase
> baseEntry, GDataRequestType type, AsyncSendData data)
>        at Google.GData.Client.Service.Batch(AtomFeed feed, Uri batchUri,
> AsyncSendData data)
>        at Google.GData.Client.Service.Batch(AtomFeed feed, Uri batchUri)
>        at GerenukPublish.PublishDates.DeleteEvents() in
> PATH\Program.cs:line 79
>        at GerenukPublish.PublishDates.Main() in PATH\Program.cs:line 37
>        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
> String[] args)
>        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
> assemblySecurity, String[] args)
>        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
>        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>        at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state, Boolean
> ignoreSyncCtx)
>        at System.Threading.ExecutionContext.Run(ExecutionContext
> executionContext, ContextCallback callback, Object state)
>        at System.Threading.ThreadHelper.ThreadStart()
>   InnerException: System.Net.WebException
>        Message=The remote server returned an error: (413) Request Entity
> Too Large.
>        Source=System
>        StackTrace:
>             at System.Net.HttpWebRequest.GetResponse()
>             at Google.GData.Client.GDataRequest.Execute()
>        InnerException:
>
>
> On Mon, Oct 31, 2011 at 11:26 AM, Alain Vongsouvanh <[email protected]>wrote:
>
>> Hello Russell,
>>
>> Are you still experiencing this issue? Have you tried running your
>> application on another computer as this error could be due to a lost
>> connection (from Google's servers or your network setup)?
>> Also, is this only happening on one specific account/domain or all of
>> your test accounts/domains?
>>
>> Thanks!
>> Alain
>>
>> On Thu, Oct 27, 2011 at 7:37 AM, Russell Reid <[email protected]> wrote:
>>
>>> I have an app that first deletes events on a shared resource calendar,
>>> and then publishes new events to the same calendar.  Yesterday the app
>>> worked fine.  Today, i get an IOException error 'Unable to write data to
>>> the transport connection: An established connection was aborted by the
>>> software in your host machine.'  at the Publish feed line.  I made no
>>> changes to the code.  I am doing the delete and the publish via the batch
>>> procedures.  I am using domain admin credentials.  The calendar is there
>>> and the Uri has not changed.  Here is my code (sans credentials):
>>>
>>> static void DeleteEvents()
>>>         {
>>>             //Create connection to gerenuk google calendar
>>>             CalendarService myService = new CalendarService("appname");
>>>             myService.setUserCredentials(userName, userPassword);
>>>
>>>             // Get some events to operate on.
>>>             EventQuery delquery = new EventQuery(feedUri);
>>>             delquery.StartDate = DateTime.Today.AddMonths(-3);
>>>             delquery.EndDate = DateTime.Today.AddMonths(3);
>>>             delquery.NumberToRetrieve = 5000;
>>>             EventFeed delfeed = myService.Query(delquery);
>>>
>>>             // Add the entries to a new feed.
>>>             AtomFeed delbatchFeed = new AtomFeed(delfeed);
>>>
>>>             //Batch delete of existing gerenuk entries
>>>             foreach (AtomEntry entry in delfeed.Entries)
>>>             {
>>>
>>>                 entry.Id = new AtomId(entry.EditUri.ToString());
>>>                 entry.BatchData = new
>>> GDataBatchEntryData(GDataBatchOperationType.delete);
>>>
>>>                 delbatchFeed.Entries.Add(entry);
>>>             }
>>>
>>>             //Publish the feed back to the calendar
>>>             EventFeed delbatchResultFeed =
>>> (EventFeed)myService.Batch(delbatchFeed, new Uri(delfeed.Batch));
>>>
>>>             //check the return values of the batch operations to make
>>> sure they all worked.
>>>             //the insert operation should return a 201 and the rest
>>> should return 200
>>>             //Maybe create a log file?
>>>             bool success = true;
>>>             foreach (EventEntry entry in delbatchResultFeed.Entries)
>>>             {
>>>                 if (entry.BatchData.Status.Code != 200 &&
>>> entry.BatchData.Status.Code != 201)
>>>                 {
>>>                     success = false;
>>>                     Console.WriteLine("The Delete batch operation with
>>> ID " +
>>>                         entry.BatchData.Id + " failed.");
>>>
>>>                 }
>>>             }
>>>
>>>             if (success)
>>>             {
>>>                 Console.WriteLine("All Delete batch operations
>>> successful!");
>>>             }
>>>
>>>
>>>
>>>         }
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html
>>>
>>
>>
>>
>> --
>> Alain Vongsouvanh | Developer Programs Engineer
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html
>>
>
>
>
> --
>
> Russell Reid LEED AP
> Consultant
>
> ACOUSTIC DIMENSIONS
> *DALLAS    NEW YORK    SAN DIEGO     UK*
>
> 15508 Wright Brothers Drive
> Addison, TX 75001
> D | 469.726.4281
> T  | 972.239.1505
>
> www.acousticdimensions.com
>
> P Please consider the environment before printing this e-mail
>
>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html
>



-- 
Alain Vongsouvanh | Developer Programs Engineer

-- 
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" 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://code.google.com/apis/calendar/community/forum.html

Reply via email to