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."'>
> > >[email protected]:43:45.575Zhttp://schemas.google.com/g/2005#batch'href='http://www.google.com/m8/feeds/contacts/testuser%40a.com/full/batch%3'>http://schemas.google.com/g/2005#kindContactshttp://www.google.com/%3Ehttp://schemas.google.com/g/2005#feed'href='http://www.google.com/m8/feeds/contacts/testuser%40a.com/full%3Ehttp:...href='http://www.google.com/m8/feeds/contacts/testuser%40a.com/full>http://schemas.google.com/g/2005#batch'href='http://www.google.com/m8/feeds/contacts/testuser%40a.com/full/batch%3......>
> > > TestUser
> > >
> > > [email protected]'>Contacts'>Contacts1'>http://www.google.com/m8/fee
> > > ds'>Contacts11
> > > 20000http://www.google.com/m8/feeds/contacts/testuser%40a.com/base/74ea98f0
> > > 0c03aa3e 2009-10-06T05:04:01.068Z
> > > 2009-10-06T05:04:01.068Z'>2009-10-06T05:04:01.068Z'>http://www.w3.org/2007/
> > > app'>2009-10-06T05:04:01.068Z http://schemas.google.com/g/2005#kind'
> > > term='http://schemas.google.com/contact/2008#contact%3EThttp://schemas.goog
> > > le .com/contacts/2008/rel#photo' type='image/*'
> > > href='http://www.google.com/m8/feeds/photos/media/testuser%40a.com/74ea98f0
> > > 0c03aa3e>
> > > http://www.google.com/m8/feeds/contacts/testuser%40a.com/full/74ea98f00c03aa3e>
> > >
> > > http://www.google.com/m8/feeds/contacts/testuser%40a.com/full/74ea98f00c03a
> > > a3e> T http://schemas.google.com/g/2005#home' [email protected]'
> > > primary='true'/>http://www.google.com/m8/feeds/groups/testuser%40a.com/base/6>
> >
> > > 2. When contacts updated:
> >
> > > Request :
> >
> > > 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
> >
> > > <?xml version="1.0" encoding="utf-8"?>
> >
> > >
> > > 2009-10-06T05:04:01.068Z'>http://www.w3.org/2007/app%22%3E2009-10-06T05:04:01.068Z
> >
> > > <gd:name>
> > > <gd:fullName>T</gd:fullName>
> > > </gd:name>
> >
> > > <gd:when startTime="1899-12-30" />
> > > </gContact:event>
> > > <gd:extendedProperty name="-2139123622"
> > > value="000000001123BB8417D3924C89AC863AA2D15AEF44D75D00" />
> > > <title type="text">T</title>
> > > http://www.google.com/m8/feeds/contacts/testuser%40a.com/base/74ea98f...
> >
> > > <content type="text" />
> > > <updated>2009-10-06T10:34:01+05:30</updated>
> > > </entry>
> >
> > > Response :
> >
> > > HTTP/1.0 400 Bad Request
> > > Content-Type: text/html; charset=UTF-8
> > > Date: Tue, 06 Oct 2009 07:43:52 GMT
> > > Expires: Tue, 06 Oct 2009 07:43:52 GMT
> > > Cache-Control: private, max-age=0
> > > X-Content-Type-Options: nosniff
> > > X-XSS-Protection: 0
> > > Server: GFE/2.0
> >
> > > Invalid request URI
> >
> > > I hope it will help you find the issue.
> >
> > > ________________________________
> > > From: Kulvinder Singh <[email protected]>
> > > To: [email protected]
> > > Sent: Tuesday, October 6, 2009 1:02:07 PM
> > > Subject: [Contacts API] Re: Invalid Request URI
> >
> > > This is the error i am getting :
> >
> > > Message : Execution of request failed:
> > > http://www.google.com/m8/feeds/contacts/[email protected]/full/74ea98f00c03aa
> >
> > > Source : Google.GData.Client
> >
> > > InnerException : The remote server returned an error: (400) Bad Request.
> >
> > > Google Server Error : Invalid request URI
> >
> > > ________________________________
> > > From: Julian (Google) <[email protected]>
> > > To: Google Contacts API <[email protected]>
> > > Sent: Thursday, October 1, 2009 4:01:35 PM
> > > Subject: [Contacts API] Re: Invalid Request URI
> >
> > > Hi,
> >
> > > What URI or code to generate the URI
> >
> > ...
> >
> > 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=.