Hi Frank, I am not overriding anything. I am simply using API without any modifications.
Thanks Kulvinder Singh ________________________________ From: Frank Mantek <[email protected]> To: [email protected] Sent: Mon, November 16, 2009 10:20:05 PM Subject: Re: [Contacts API] Re: Invalid Request URI Kulvinder, is it possible that some outside proxy is changing the PUTs to POSTs? I am 100% positive that this works fine in the .NET library in general, and there is no way you can force the library to use a POST (as long as you have not discovered one :)) for an update WITHOUT the x-method override header being present as well. Frank On Nov 16, 2009, at 5:31 PM, Lukasz (Google) wrote: > Hi Kulvinder, Frank > > I noticed the header of one of the quoted update requests looks like > this: > POST /m8/feeds/contacts/syncmycaltestuser%40vidyamandir.com/full/ > 74ea98f00c03aa3 e HTTP/1.1 > Etag: "QH49cDVSLyt7ImA9WxNXGE0PQwA." > If-Match: "QH49cDVSLyt7ImA9WxNXGE0PQwA." > Content-Type: application/atom+xml; charset=UTF-8 > User-Agent: G-Technologies Inc. - Syncmycal/GDataGAuthRequestFactory- > CS-Version=1.5.0.0 > Authorization: GoogleLogin > auth=DQAAAJkAAADTFkrcfCnDqICs4VfGoLqUIPpbv33xaMPD_vk5J7xfZ5Ttv_IEzlhx- > OSh7Q JHTzcq0AQW2IO5zQ3oy3T3dhJb > GData-Version: 3.0 > Host: www.google.com > Content-Length: 1838 > Expect: 100-continue > Connection: Keep-Alive > > The important thing here is that the POST method is used. For updates, > the PUT method should be used instead. > This can be achieved either by using the regular HTTP PUT method, or > (if some intervening proxy causes problems) > by using the POST method combined with the "X-HTTP-Method-Override: > PUT" header. > > Hope this helps, > -- Lukasz > > On Nov 16, 2:59 pm, Frank Mantek <[email protected]> wrote: >> Ok, >> >> i modified the contacts application that you get when you run the contacts >> app wizard in VS. I added a button on the form. This button does this: >> >> private void button1_Click(object sender, EventArgs e) >> { >> ListViewItem item = this.listView.SelectedItems[0]; >> if (item != null) >> { >> ContactEntry ce = item.Tag as ContactEntry; >> if (ce != null) >> { >> ce.Name.FullName = "The new Full Name"; >> ce.Name.GivenName = "something else"; >> this.contactsService.Update(ce); >> } >> } >> } >> >> So i take the currently selected contact and change the fullname and the >> givenname (i tried both solo as well) and update. This should match your >> scenario, correct? >> >> Works great for me. I see nothing wrong in the .NET code, nor do i see >> anything wrong in what is on the wire (neither for my code, nor what you >> send me). >> >> Ball is in the court of the contacts service team. I am going to send this >> around internally, maybe someone will answer. >> >> Frank Mantek >> Google >> On Nov 16, 2009, at 1:44 PM, Kulvinder Singh wrote: >> >> >> >>> Hi Frank, >> >>> Let me explain the scenario again. >> >>> 1. I created a contact in Google. >> >>> 2. Downloaded the contact. >> >>> 3. Updating the Full name of the contact. >> >>> 4. Tried to update the contact but got an exception. >> >>> ContactsQuery query = new ContactsQuery(); >>> ContactsService service = new ContactsService("testApp-0.1"); >>> service.setUserCredentials("[email protected]", "PASSWORD"); >>> query.Uri = new >>> Uri("http://www.google.com/m8/feeds/contacts/[email protected]/full"); >>> ContactsFeed calFeed = service.Query(query); >>> AtomEntryCollection gcalEvents = calFeed.Entries; >>> ContactEntry ce = gcalEvents[0] as ContactEntry; >>> ce.Name.FullName = "New Contact Name"; >>> ce = service.Update(ce) as ContactEntry; >> >>> The XML feed i have already sent to you in an email. Please help me ASAP. >> >>> Thanks >>> Kulvinder Singh >> >>> From: Frank Mantek <[email protected]> >>> To: Google Contacts API <[email protected]> >>> Sent: Mon, November 16, 2009 2:55:45 PM >>> Subject: [Contacts API] Re: Invalid Request URI >> >>> I read through this thread and looked at the XML Kulvinder provided. >>> This does not look to be a .NET client issue. >> >>> a) the error is completely bogus. This is of course NOT an invalid >>> request URI. I can not judge if the etags are correct when send, but i >>> assume so (we do use etags in all kind of services, so it would >>> surprise me if it did not work here, and i do believe the server would >>> return a different error if the etag was wrong). >> >>> b) The update entry looks fine to me at least. If it does not match >>> the minimum requirements, again, the error should indicate this. >> >>> What i am a tad confused about is a sentence indicating that this is >>> an entry that is already deleted? Can you explain. >> >>> Frank Mantek >>> Google >> >>> Sorry for the late reply, but this just got lost somewhere in my >>> inbox.... >> >>> On Nov 10, 7:22 am, Kulvinder Singh <[email protected]> wrote: >>>> Hi Julian, >> >>>> My issue is still not fixed. Please help. I am not getting where i am >>>> doing wrong. >> >>>> Thanks >>>> Kulvinder Singh >> >>>> ________________________________ >>>> From: Kulvinder Singh <[email protected]> >>>> To: [email protected] >>>> Sent: Thu, October 29, 2009 9:53:05 AM >>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>> Hi Hulian, >> >>>> I tried for different user as well but still getting the same issue. I >>>> have emailed you the credentials for one of the user on which i am >>>> testing. Please check. >> >>>> Thanks >>>> Kulvinder Singh >> >>>> ________________________________ >>>> From: Julian (Google) <[email protected]> >>>> To: Google Contacts API <[email protected]> >>>> Sent: Wed, October 28, 2009 1:42:34 PM >>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>> I was able to run your code after downloading the latest version from >>>> the SVN: >> >>>> ContactsQuery query = new ContactsQuery(); >>>> ContactsService service = new ContactsService("testApp-0.1"); >>>> service.setUserCredentials("[email protected]", "PASSWORD"); >>>> query.Uri = new Uri("http://www.google.com/m8/feeds/contacts/ >>>> [email protected]/full"); >> >>>> ContactsFeed calFeed = service.Query(query); >>>> AtomEntryCollection gcalEvents = calFeed.Entries; >>>> ContactEntry ce = gcalEvents[0] as ContactEntry; >>>> ce.Name.FullName = "New Contact Name"; >>>> ce = service.Update(ce) as ContactEntry; >> >>>> Can you try with a different user? Maybe the problem is specific to >>>> one user, please let me know the user to investigate further if the >>>> problem persists. >> >>>> Cheers, >>>> Julian >> >>>> On Oct 23, 12:29 pm, Kulvinder Singh <[email protected]> wrote: >> >>>>> Julian, >> >>>>> Can you please reply to this ? >> >>>>> Thanks >>>>> Kulvinder Singh >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 20, 2009 4:24:44 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> I have created a simplest code to prove this and getting the error : >> >>>>> ContactsQuery query = new ContactsQuery(); >>>>> ContactsService service = new >>>>> ContactsService("testApp-0.1"); >> >>>>> service.setUserCredentials("[email protected]", >>>>> "password"); >> >>>>> query.Uri = new >>>>> Uri("http://www.google.com/m8/feeds/contacts/[email protected]/full"); >> >>>>> ContactsFeed calFeed = service.Query(query); >>>>> AtomEntryCollection gcalEvents = calFeed.Entries; >> >>>>> ContactEntry ce = gcalEvents[0] as ContactEntry; >> >>>>> ce.Name.FullName = "New Name"; >> >>>>> ce = service.Update(ce) as ContactEntry; >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 20, 2009 4:10:16 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> Also, the same code was working fine before i was using Contacts API 1.0 >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 20, 2009 2:22:22 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> I am updating a contact using the following code : >> >>>>> ContactService contactService = new ContactService("ApplicationName"); >>>>> contactService.Credentials = new GDataCredentials(userName, password); >>>>> Uri postUri = new Uri(ContactsQuery.CreateContactsUri(userName)); >> >>>>> contactService.Update(gContactEvent); >> >>>>> WHAT IS GOING WRONG ? >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 20, 2009 1:37:41 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> Even adding a new contact and updating it again is throwing this error. >>>>> Please see the XML feed below. >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 20, 2009 1:27:39 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> I have debugged the issue. Actually, there is a contact in my account >>>>> which i have deleted but still i am getting it in the feed and my program >>>>> is trying to delete that contact since it is available and i am getting >>>>> this error. Please tell me how to overcome this. >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tue, October 6, 2009 2:34:03 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> Also, the same code was working fine before i was using COntacts API 1.0 >> >>>>> ________________________________ >>>>> From: Kulvinder Singh <[email protected]> >>>>> To: [email protected] >>>>> Sent: Tuesday, October 6, 2009 2:14:44 PM >>>>> Subject: [Contacts API] Re: Invalid Request URI >> >>>>> I simply downloaded the contact, made some modifications in its data and >>>>> used : >> >>>>> contactService.Update(gContactEvent); >> >>>>> which threw the error. For your reference, i am also writing here the XML >>>>> feed which i got when i downloaded the contact, feed which i posted for >>>>> editing and feed which i got back : >> >>>>> 1. When contacts retreived : >> >>>>> Request : >> >>>>> GET /m8/feeds/contacts/testuser%40a.com/full?max-results=20000 HTTP/1.1 >>>>> Content-Type: application/atom+xml; charset=UTF-8 >>>>> User-Agent: G-Technologies >>>>> Inc./GDataGAuthRequestFactory-CS-Version=1.5.0.0 >>>>> Authorization: GoogleLogin >>>>> auth=DQAAAJoAAABGaRrbsqiOMPeEv99CwMb1boWMQnsRRx5XAftSlr2SN9fBRoymsC3OzXOAwY >>>>> XfHd_AqV37Zd8TH3031cnNnu1k >>>>> GData-Version: 3.0 >>>>> Host:www.google.com >> >>>>> Response : >> >>>>> HTTP/1.0 200 OK >>>>> Content-Type: application/atom+xml; charset=UTF-8; type=feed >>>>> Expires: Tue, 06 Oct 2009 07:43:45 GMT >>>>> Date: Tue, 06 Oct 2009 07:43:45 GMT >>>>> Cache-Control: private, max-age=0, must-revalidate, no-transform >>>>> Vary: Accept, X-GData-Authorization, GData-Version >>>>> GData-Version: 3.0 >>>>> ETag: W/"D0cGRHs8fSt7I." >>>>> Last-Modified: Tue, 06 Oct 2009 07:43:45 GMT >>>>> X-Content-Type-Options: nosniff >>>>> X-XSS-Protection: 0 >>>>> Server: GFE/2.0 >> >>>>> http://www.w3.org/2005/Atom."'> >> >> ... >> >> read more ยป > > -- > > You received this message because you are subscribed to the Google Groups > "Google Contacts API" group. > To post to this group, send email to [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-contacts-api?hl=. > > -- You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=. -- You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=.
