I'm using the .NET api now, although I've seen exactly the same
through the Java API, so it would suggest this is a server issue.
When I create a contact there is some kind of race condition, meaning
that _sometimes_ (about 1 in 3) I cannot upload an image for that
contact.
To create the contact:
Uri feedUri = new Uri
(ContactsQuery.CreateContactsUri("default")); // This appears to be
redundent
Feed<Contact> feed = cr.GetContacts();
entry = cr.Insert(feed, entry);
updatePicture();
To upload the photo:
// I've tried up to a 1 min delay before this.
entry = cr.Update(entry);
Console.WriteLine(entry.PhotoUri);
cr.SetPhoto(entry, photoStream);
I get a GDataRequestException:
{"Execution of request failed:
http://www.google.com/m8/feeds/photos/media/[email protected]/20d591310a37df9d"}
{"The remote server returned an error: (404) Not Found."}
However, when I query the feed, it's there, I get:
<entry>
<id>http://www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/
base/20d591310a37df9d</id>
<updated>2009-12-16T22:28:40.737Z</updated>
<category scheme='http://schemas.google.com/g/2005#kind' term='http://
schemas.google.com/contact/2008#contact'/>
<title type='text'>xxxxxxx</title>
<content type='text'></content>
<link rel='http://schemas.google.com/contacts/2008/rel#edit-photo'
type='image/*' href='http://www.google.com/m8/feeds/photos/media/
testuser%40longhome.co.uk/20d591310a37df9d/1B2M2Y8AsgTpgAmY7PhCfg'/>
<link rel='self' type='application/atom+xml' href='http://
www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/full/20d591310a37df9d'/>
<link rel='edit' type='application/atom+xml' href='http://
www.google.com/m8/feeds/contacts/testuser%40longhome.co.uk/full/20d591310a37df9d/1261002520737000'/>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>+
+44xxxxxxxxx</gd:phoneNumber>
</entry>
--
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].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-contacts-api?hl=en.