I get the below exception when trying to do a query for against the
contact service using 2 legged oauth.
java.lang.NullPointerException: No authentication header information
at
com.google.gdata.util.AuthenticationException.initFromAuthHeader(AuthenticationException.java:
96)
at
com.google.gdata.util.AuthenticationException.<init>(AuthenticationException.java:
67)
at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:
600)
at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:
563)
at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:
552)
at
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:
530)
at
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:
535)
at com.google.gdata.client.Service.getFeed(Service.java:1135)
at com.google.gdata.client.Service.getFeed(Service.java:1077)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
662)
at com.google.gdata.client.Service.getFeed(Service.java:1034)
at com.myapp.findContacts(DesktopServiceImpl.java:433)
This is particularly odd, since right before the contact query
executes I can do a search against the documents API just fine and I
get back the list of documents for this user.
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(<<private>>);
oauthParameters.setOAuthConsumerSecret(<<private>>);
ContactsService contactsService = new
ContactsService(APPLICATION_NAME);
contactsService.setOAuthCredentials(oauthParameters , new
OAuthHmacSha1Signer());
ContactQuery query = new ContactQuery (new URL("https://www.google.com/
m8/feeds/contacts/default/full")));
query.addCustomParameter(new CustomParameter("xoauth_requestor_id",
getCurrentUser().getEmail())); /
query.setFullTextQuery(search);
ContactFeed feed = contactsService.getFeed(query, ContactFeed.class);
Any help would be greatly appreciated.
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" 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://code.google.com/apis/contacts/community/forum.html