3

I am trying to update / delete contacts or groups using Batch operation using Contacts API(java).

Code :

ContactsService contactService;
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(key);
oauthParameters.setOAuthConsumerSecret(secret);
contactService = new ContactsService(appname);
contactService.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());
ContactFeed feed = new ContactFeed();
ContactEntry contact = new ContactEntry();
contact.setId(atomId.replace("/base/", Matcher.quoteReplacement("/thin/")));
BatchUtils.setBatchId(contact, seqId);
BatchUtils.setBatchOperationType(contact, BatchOperationType.DELETE);
feed.getEntries().add(contact);
if (hasDeleteOperaion) {
  contactsService.setHeader("If-Match", "*");
}
feed = contactsService.batch(feedUrl, feed);
if (hasDeleteOperaion) {
  contactsService.setHeader("If-Match", null);
}

while executing the above code, getting the following exception:

com.google.gdata.util.ServiceException: Internal Server Error
Internal Error
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:632)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536)
at com.google.gdata.client.Service.batch(Service.java:1454)
at com.google.gdata.client.GoogleService.batch(GoogleService.java:770)

I am getting this recently from last week and I have not yet implemented the OAUTH 2.0 for MarketPlace Apps.

Is there any solution for this, can anyone help with this?

Kumar D
  • 1,308
  • 5
  • 19
  • 43
Karthick T
  • 123
  • 1
  • 10
  • And getting this exception inconsistently & frequently, sometimes getting for delete, sometimes for update/insert, but getting frequently, like half works and for half above exception is thrown. – Karthick T Apr 25 '14 at 09:39
  • Seems google fixed this issue and service working fine now. – Kumar D Apr 26 '14 at 13:36

0 Answers0