Sorry that was my silly mistake in the initial call i was setting the scope for google docs and in the authrization token i was asking for contacts information and google was kicking me out :)
On Nov 18, 9:09 pm, Travelling Rants <[email protected]> wrote: > An update > i tried above code with google docs and it was working fine no idea > whats wrong with the Contact? > > On Nov 18, 5:35 pm, Travelling Rants <[email protected]> > wrote: > > > > > > > > > Any inputs on this as i am strucked here > > > On Nov 17, 11:21 pm, Travelling Rants <[email protected]> > > wrote: > > > > Hi All, > > > > I am trying to access contacts using gdata client library.when i am > > > trying to access the contacts i am facing following exception > > > > java.lang.NullPointerException: No authentication header information > > > > com.google.gdata.util.AuthenticationException.initFromAuthHeader(Authentica > > > tionException.java: > > > 96) > > > > com.google.gdata.util.AuthenticationException.<init>(AuthenticationExceptio > > > n.java: > > > 67) > > > > com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGData > > > Request.java: > > > 600) > > > > com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleG > > > DataRequest.java: > > > 563) > > > > com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataReques > > > t.java: > > > 552) > > > > com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java > > > : > > > 530) > > > > com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest. > > > java: > > > 535) > > > com.google.gdata.client.Service.getFeed(Service.java:1135) > > > com.google.gdata.client.Service.getFeed(Service.java:998) > > > > > > com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631) > > > com.google.gdata.client.Service.getFeed(Service.java:1017) > > > com.raisonne.oauth.CallBackAction.execute(CallBackAction.java:62) > > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > Hers is the client code i have written to communicate with the service > > > > GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); > > > > oauthParameters.setOAuthConsumerKey("xyz"); > > > > oauthParameters.setOAuthConsumerSecret("secret"); > > > GoogleOAuthHelper oauthHelper = new > > > GoogleOAuthHelper(new > > > OAuthHmacSha1Signer()); > > > oauthParameters.setScope(SCOPE); > > > oauthParameters.setOAuthVerifier(oauth_verifier); > > > oauthParameters.setOAuthToken(oauth_token); > > > > oauthParameters.setOAuthTokenSecret(session.get("oauth_token_secret").toStr > > > ing()); > > > String token = > > > oauthHelper.getAccessToken(oauthParameters); > > > ContactsService client=new ContactsService > > > ("mydemoapp"); > > > client.setOAuthCredentials(oauthParameters, new > > > OAuthHmacSha1Signer()); > > > URL feedUrl = new > > > URL("http://www.google.com/m8/feeds/ > > > contacts/default/base"); > > > ContactFeed resultFeed = client.getFeed(feedUrl, > > > ContactFeed.class); > > > > for (int i = 0; i < > > > resultFeed.getEntries().size(); i++) { > > > ContactEntry entry = (ContactEntry) > > > resultFeed.getEntries().get(i); > > > System.out.println("|\t" + (i + 1) + ": " > > > + entry.getTitle().getPlainText()); > > > } > > > > i am getting this exception at this line > > > > ContactFeed resultFeed = client.getFeed(feedUrl, ContactFeed.class); > > > > can any one help me to find out what exactly i am doing wrong? > > > > thanks in advance -- 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
