Hi,
When using the DLLs from subversion depot mentioned by Frank, you can
set the timeout property by using the following code:
MailItemService service = new
MailItemService("example.com", "Your Application");
GDataRequestFactory factory = ((GDataRequestFactory)
(service.RequestFactory));
factory.Timeout = 60000 ; //milliseconds value
Thanks,
Anirudh
On May 29, 8:11 pm, Bam <[EMAIL PROTECTED]> wrote:
> Sorry i dont find about service??
>
> this is my sample code.
>
> public static void Migration(MailItemService mailItemService, string[]
> arrMessage, string userName, string domain, string place, string[]
> IsRead)
> {
> //try
> //{
> // get authentication
>
> MailItemEntry[] entries = new
> MailItemEntry[arrMessage.Length];
>
> // populate email that can be entered
> for (int i = 0; i < entries.Length; i++)
> {
> entries[i] = SetupMailItemEntry(i.ToString(),
> arrMessage[i], place, IsRead[i]);
> }
>
> // batch processing
> MailItemFeed batchResult = mailItemService.Batch(domain,
> userName, entries);
>
> // display result
> string strResult = "";
> //foreach (AtomEntry entry in batchResult.Entries)
> //{
> // GDataBatchEntryData batchData = entry.BatchData;
> // strResult += batchData.Status.Reason + "|";
> //}
> //return strResult;
> //}
> //catch (Exception ex)
> //{
> // throw ex;
> //}
> }
>
> private static MailItemEntry SetupMailItemEntry(string batchId,
> string message, string place, string isRead)
> {
> //try
> //{
> MailItemEntry entry = new MailItemEntry();
>
> if (place.ToUpper() == "INBOX")
>
> entry.MailItemProperties.Add(MailItemPropertyElement.INBOX);
> else if (place.ToUpper() == "DRAFT")
>
> entry.MailItemProperties.Add(MailItemPropertyElement.DRAFT);
> else if (place.ToUpper() == "SENT")
>
> entry.MailItemProperties.Add(MailItemPropertyElement.SENT);
> else if (place.ToUpper() == "TRASH")
>
> entry.MailItemProperties.Add(MailItemPropertyElement.TRASH);
> else
> entry.Labels.Add(new LabelElement(place));
>
> if(isRead.ToUpper() == "UNREAD")
>
> entry.MailItemProperties.Add(MailItemPropertyElement.UNREAD);
>
> // set label message in Gmail
> //entry.Labels.Add(new LabelElement("Friends"));
> //entry.Labels.Clear();
> // set email message pattern
> entry.Rfc822Msg = new Rfc822MsgElement(message);
>
> entry.BatchData = new GDataBatchEntryData();
> entry.BatchData.Id = batchId;
>
> return entry;
> //}
> //catch (Exception ex)
> //{
> // throw ex;
> //}
> }
>
> Thanks for your help.
>
> On May 29, 5:39 pm,FrankMantek <[EMAIL PROTECTED]> wrote:
>
>
>
> > Sure.
>
> > Assume you have the service created:
>
> > GDataRequestFactory factory = (GDataRequestFactory)
> > service.factory;
> > factory.Timeout = 60000; // this is in milliseconds
>
> > That should do it. If it does not, i need more information on what's
> > going wrong, or a sample code to repro (i have a hard time to create
> > timeouts consistently :))
>
> >Frank
> > On May 29, 2008, at 3:28 AM,Bamwrote:
>
> > > I have try it. but no differently.
>
> > > Can you give me sample code how to increase timeout property on the
> > > request factory??
>
> > > Thanks,
>
> > > On May 6, 8:31 pm,FrankMantek <[EMAIL PROTECTED]> wrote:
> > >> Hah. Good point. I thought i had to add that in the past for some
> > >> other request, but i was mistaken...
>
> > >> I just added this capability. If you go to the subversion depot and
> > >> download the DLLs using subversion (there is no official build yet,
> > >> this will come when youtube support is done and tested), you can try
> > >> this out.
>
> > >>http://code.google.com/p/google-gdata/source/checkout
>
> > >>FrankMantek
> > >> Google
> > >> On May 6, 2008, at 10:03 AM,Bamwrote:
>
> > >>> How to set the timeout property on the requestfactory object??
>
> > >>> I am using .Net client library.
>
> > >>> Thanks,
>
> > >>> On May 5, 2:27 pm,FrankMantek <[EMAIL PROTECTED]> wrote:
> > >>>> In this case you might want to set the timeout property on the
> > >>>> requestfactory object of the service you are using....
>
> > >>>>FrankMantek
> > >>>> Google
> > >>>> On May 5, 2008, at 8:28 AM,Bamwrote:
>
> > >>>>> Hi,
>
> > >>>>> I also get this error message.
>
> > >>>>> Google.GData.Client.GDataRequestException: Execution of request
> > >>>>> failed:https://apps-apis.google.com/a/feeds/migration/2.0/domainName/usernam
> > >>>>> ...
> > >>>>> ---> System.Net.WebException: The operation has timed out at
> > >>>>> System.Net.HttpWebRequest.GetResponse() at
> > >>>>> Google.GData.Client.GDataRequest.Execute() --- End of inner
> > >>>>> exception
> > >>>>> stack trace --- at Google.GData.Client.GDataRequest.Execute() at
> > >>>>> Google.GData.Client.GDataGAuthRequest.Execute(Int32 iRetrying) at
> > >>>>> Google.GData.Client.GDataGAuthRequest.Execute() at
> > >>>>> Google.GData.Client.Service.StreamInsert(Uri feedUri, AtomBase
> > >>>>> baseEntry, GDataRequestType type) at
> > >>>>> Google.GData.Client.Service.Batch(AtomFeed feed, Uri batchUri) at
> > >>>>> Google.GData.Apps.Migration.MailItemService.Batch(String domain,
> > >>>>> String userName, MailItemEntry[] entries) at
> > >>>>> EmailMigration.Migration(MailItemService mailItemService, String[]
> > >>>>> arrMessage, String userName, String domain, String place, String[]
> > >>>>> IsRead) in c:\Inetpub\wwwroot\EmailMigration\App_Code
> > >>>>> \EmailMigration.cs:line 47 at TotalSize.Page_Load(Object sender,
> > >>>>> EventArgs e) in c:\Inetpub\wwwroot\EmailMigration
> > >>>>> \TotalSize.aspx.cs:line 240
>
> > >>>>> How about it??
>
> > >>>>> Thanks a lot
>
> > >>>>> On Apr 17, 7:14 am, "Q (Google)" <[EMAIL PROTECTED]> wrote:
> > >>>>>> Hi,
>
> > >>>>>> To stay under the 32MB limit per POST request, you can try
> > >>>>>> putting in
> > >>>>>> your code a size count for each message. Then, you can batch up
> > >>>>>> your
> > >>>>>> messages one by one until you reach some size just under 32MB
> > >>>>>> before
> > >>>>>> sending the batch in a request.
>
> > >>>>>> Keep in mind that the maximum message size that Gmail accepts is
> > >>>>>> 20MB,
> > >>>>>> so you are not likely to encounter a single message that is over
> > >>>>>> 32MB
> > >>>>>> in size:
>
> > >>>>>>http://mail.google.com/support/bin/answer.py?answer=6589
>
> > >>>>>> To learn more about the Email Migration API and batch processing,
> > >>>>>> please visit these links:
>
> > >>>>>>http://code.google.com/apis/apps/email_migration/developers_guide_pro
> > >>>>>> ...
>
> > >>>>>> -Q
>
> > >>>>>> On Apr 7, 2:04 am,Bam<[EMAIL PROTECTED]> wrote:
>
> > >>>>>>> when i might post 500MB email messages which one request maximum
> > >>>>>>> of
> > >>>>>>> 32MB of data??- Hide quoted text -
>
> > >>>>>> - Show quoted text -- Hide quoted text -
>
> > >>>> - Show quoted text -- Hide quoted text -
>
> > >> - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps 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-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---