I have not tried this with your code snippet, but.... When you create a Service object, by passing in 2 arguments, the Service will create a GDataGAuthRequest factory to use, as it knows from the arguments that you plan to talk to a Google service, hence this authentication is required.
So, you cold change the line: > GDataRequestFactory f = (GDataRequestFactory)service.RequestFactory; > to GDataGAuthRequestFactory f = service.RequestFactory as GDataGAuthRequestFactory so, now you have the right factory, you should just be able to set the properties there. Let me know if that works or helps you - it should, as we have tested it a while ago. But i have to admit that this failure mechanism is not something i run regularly, as it is very cumbersome to test. Frank Mantek Google On Sep 4, 2007, at 6:12 AM, Kulvinder Singh wrote: > Hi Frank, > > I am trying to handle Captcha Response in my code during > clientLogin but the problem is how do i set the CaptchaAnswer and > CaptchaToken in the next request once the client has replied to the > Captcha Challenge. > I have written a code which takes the user input in case there is a > Captcha error but i am not able to set the input to the Request in > the QueryAuthToken method in gdataRequest.cs > Actually, this method uses a factory instance of > GDataAuthRequestFactory which has properties for CaptchaAnswer and > CaptchaToken and i am not able to get the way to set these > properties in this factory instance. > My code is below : > > Service service = new Service(CalendarService.GCalendarService, > "AppName"); > service.setUserCredentials(UserName, Password); > FeedQuery query = new FeedQuery(); > query.Uri = new Uri(http://www.google.com/calendar/feeds/default;); > GDataRequestFactory f = (GDataRequestFactory)service.RequestFactory; > f.Proxy = myProxy; > > //Get calender feed > AtomFeed af = service.Query(query); > > Since "f" is a GDataRequestFactory object and not > GDataAuthRequestFactory and although GDataRequestFactory is a base > class for GDataAuthRequestFactory how do i set the values of > CaptchaAnswer and CaptchToken while getting the AuthToken : > > // now enter the data in the stream > string postData = GoogleAuthentication.Email + "=" + > Utilities.UriEncodeReserved(nc.UserName) + "&"; > postData += GoogleAuthentication.Password + "=" + > Utilities.UriEncodeReserved(nc.Password) + "&"; > postData += GoogleAuthentication.Source + "=" + > Utilities.UriEncodeReserved(this.factory.ApplicationName) + "&"; > postData += GoogleAuthentication.Service + "=" + > Utilities.UriEncodeReserved(this.factory.Service) + "&"; > if (this.factory.CaptchaAnswer != null) > { > postData += GoogleAuthentication.CaptchaAnswer + "=" + > Utilities.UriEncodeReserved(this.factory.CaptchaAnswer) + "&"; > } > if (this.factory.CaptchaToken != null) > { > postData += GoogleAuthentication.CaptchaToken + "=" + > Utilities.UriEncodeReserved(this.factory.CaptchaToken) + "&"; > } > postData += accountType; > > The code above has been taken from QueryAuthToken method. > > Can you tell me how can i set the CaptchaAnswer and CaptchToken > attributes which GDataAuthRequestFactory requires from Client ? > > Thanks > > ----- Original Message ---- > From: Frank Mantek <[EMAIL PROTECTED]> > To: [email protected] > Sent: Monday, September 3, 2007 3:41:32 PM > Subject: Re: New version of the Java client library (1.14.0) > > I am working on a new release with the target of the next one or > two weeks. Is there anything in particular that you are waiting for? > > Currently, my most important item in there is partial Picasa > support and ASP.NET support. > > Frank Mantek > Google > On Sep 3, 2007, at 11:21 AM, Kulvinder Singh wrote: > >> Hi Lane, >> Any tentative date when you will be releasing new Client library >> for .NET ? >> Thanks >> Kulvinder Singh >> ----- Original Message ---- >> From: Lane LiaBraaten (Google) <[EMAIL PROTECTED]> >> To: Google Calendar Data API <google-calendar-help- >> [EMAIL PROTECTED]> >> Sent: Wednesday, August 29, 2007 9:14:14 PM >> Subject: New version of the Java client library (1.14.0) >> >> Hey Java Users, >> >> The latest version of the Java client library removes the requirement >> for you to download the mail.jar and activation.jar files since the >> Calendar data API doesn't really use them. >> >> For more details about the release see: >> http://groups.google.com/group/google-help-dataapi/browse_thread/ >> thread/72e371686af0dd62 >> >> To download the client library go to: >> http://code.google.com/p/gdata-java-client/downloads/list >> >> Cheers, >> Lane >> >> >> >> >> Moody friends. Drama queens. Your life? Nope! - their life, your >> story. >> Play Sims Stories at Yahoo! Games. >> >> >> > > > > > Shape Yahoo! in your own image. Join our Network Research Panel today! > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
