Hi ,

Its of great pleasure to know that google have launched API's to fetch
the contact list.
I had downloaded the specified jar files and made an attempt to run
the same.

The following java code was used by me.
But it is throwing an exception stating bad request. Exception details
are given at the bottom.

package sample.contacts;

import com.google.gdata.client.*;
import com.google.gdata.client.calendar.*;
import com.google.gdata.data.*;
import com.google.gdata.data.contacts.ContactEntry;
import com.google.gdata.data.contacts.ContactFeed;
import com.google.gdata.data.extensions.*;
import com.google.gdata.util.*;
import java.net.URL;
import com.google.gdata.client.contacts.ContactsService;

public class GetContacts{

        public static void main(String argsp[]){

                        try{

                                URL feedUrl = new 
URL("http://www.google.com/m8/feeds/";);


                            ContactsService service = new 
ContactsService("Google-
contactsExampleApp-1");
                            String userName = "[EMAIL PROTECTED]";
                            String password = "password";
                            if (userName == null || password == null) {
                              return;
                            }
                            service.setUserCredentials(userName, password);

                            ContactFeed resultFeed = service.getFeed(feedUrl,
ContactFeed.class);


                        }catch(Exception e){
                                System.out.println("exception -->");
                                e.printStackTrace();
                        }


        }


}

Exception
------------------

 Bad Request
Invalid request URI.

        at
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:
557)
        at
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:
541)
        at
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:
535)
        at
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:
513)
        at
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:
514)
        at com.google.gdata.client.Service.getFeed(Service.java:696)
        at com.google.gdata.client.Service.getFeed(Service.java:641)
        at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
529)
        at com.google.gdata.client.Service.getFeed(Service.java:724)
        at sample.contacts.GetContacts.main(GetContacts.java:32)


---------------

Can anybody help me with what could be the possible error?

Thanks and regards,
Unni Sankarankutty.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Data 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-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to