Hi Frank, Is there a way by which i can keep track of the "total" data which is sent in request ?
I mean in many cases, i used to get 500 errors and i want to know what exactly was sent which server rejected out. So, do you think that these log files will be sufficient enough ? I mean if i want to know what was exactly being sent to server that created a problem. > although i don't understand why you are doing this from the inside of the > service? btw, is it possible that you are replacing the factory later in the > code somewhere? If i dont create the loggingfactory object from the Calendar Service constructor then where should i create it ? I mean this should be the ideal place. Kindly let me know what way it will be better. What would be the easiest way out then ? Thanks Kulvinder Singh ----- Original Message ---- From: Frank Mantek <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, September 21, 2007 5:54:16 PM Subject: Re: How to log Response and Request for Google Calendar API ? RequestCopy will only hold data when you actually send something to the server (like Insert/Update). In a normal query case, the code that would save out the received data is in public override Stream GetResponseStream(). Are you maybe not looking in the right place for the files? Where are your DLLs when they are executed? Did you try debugging into it? because if the factory is correctly set (although i don't understand why you are doing this from the inside of the service? btw, is it possible that you are replacing the factory later in the code somewhere?) it should try to write those files. And if the writing fails due to the insufficient access rights, you should get an error.... Frank Mantek Google On Sep 21, 2007, at 1:54 PM, Kulvinder Singh wrote: I looked at the code again (logrequest.cs) and checked where it saves the file. public override void Execute() { if (this.RequestCopy != null) { this.RequestCopy.Seek(0, SeekOrigin.Begin); SaveStream(this.RequestCopy, this.strInput); this.RequestCopy.Seek(0, SeekOrigin.Begin); } try { base.Execute(); } catch (GDataRequestException re) { Tracing.TraceMsg("Got into exception handling for base.execute"); HttpWebResponse response = re.Response as HttpWebResponse; if (response != null) { Stream req = response.GetResponseStream(); SaveStream(req, this.strOutput); } throw re; } } It seems that the RequestCopy is always null and is read only and is set when GetRequestStream() method is called and which is called only when base.Execute() is called. Frank, Can you help ? Thanks Kulvinder Singh ----- Original Message ---- From: Kulvinder Singh <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, September 21, 2007 5:01:38 PM Subject: Re: How to log Response and Request for Google Calendar API ? Hi Frank, Thanks for your kind reply. I tried out the changes in CalenderService.cs in the following manner : /// <summary> /// default constructor /// </summary> /// <param name="applicationName">the applicationname</param> public CalendarService(string applicationName) : base(GCalendarService, applicationName, GCalendarAgent) { this.NewFeed += new ServiceEventHandler(this.OnNewFeed); // You can set factory.methodOverride = true if you are behind a // proxy that filters out HTTP methods such as PUT and DELETE. GDataLoggingRequestFactory factory = new GDataLoggingRequestFactory(GCalendarService, applicationName); factory.MethodOverride = true; // No of Retries is 0 by default. So, set it to 3 so that it will try it again for the Response factory.NumberOfRetries = 3; this.RequestFactory = factory; } the code runs fine but still i dont see the files i require which contains all the information regarding what was actually sent and what was received. These files are supposed to be this.strInput = "GDatarequest.xml"; this.strOutput = "GDataresponse.xml"; this.strCombined = "GDatatraffic.log"; but there is no files as such. Can you help again ? Thanks Kulvinder Singh ----- Original Message ---- From: Frank Mantek <[EMAIL PROTECTED]> To: [email protected] Sent: Friday, September 21, 2007 4:06:31 PM Subject: Re: How to log Response and Request for Google Calendar API ? Yes. Go to the client/cs/src/unittests and check out unittests.cs If you just set the factory used to be of kind GDataLoggingRequestFactory, all data will automatically be logged in the current directory as xml and log files (see the implementation of GDataLoggingRequest.cs for details). Let me know if you need any more help. Frank Mantek Google On Sep 21, 2007, at 11:57 AM, Kulvinder Singh wrote: Hi, To debug the problem which a user faces on his machine, i want to know whether there is a way by which i can figure out what data was sent to the Google server and what was actually recieved ? I see that there is a GDataLoggingRequest.cs class as well but i dont know how do i enable the tracing in my application so that all the data being sent and being recieved can be sent by a user and i can debug the issue. Any ideas ? Thanks Kulvinder Singh Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. Pinpoint customers who are looking for what you sell. Pinpoint customers who are looking for what you sell. ____________________________________________________________________________________ Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545433 --~--~---------~--~----~------------~-------~--~----~ 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://groups.google.com/group/google-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
