hoangduit / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

issue 189 not fixed #351

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

RequestSettings rs = new RequestSettings(ProductName, tbUser, tbPass);
rs.AutoPaging = true;
ContactsRequest cr = new ContactsRequest(rs);

ContactsQuery cq = new 
ContactsQuery(ContactsQuery.CreateContactsUri("default"));
cq.Group = "Contacts";

Feed<Contact> fc = cr.Get<Contact>(cq);
foreach (Contact c in fc.Entries)
{
  //do stuff
}

What is the expected output? What do you see instead?

I expect contacts in the 'My Contacts' groups but I get an exception:

Google.GData.Client.GDataRequestException: Execution of request failed: 
http://www.google.com/m8/feeds/contacts/default/full?group=Contacts ---> 
System.Net.WebException: השרת המרוחק החזיר שגיאה: (400) 
בקשה שגויה.

(The server returned an error: (400) Bad Request)

What version of the product are you using? On what operating system?
1.4.0.2

Original issue reported on code.google.com by roi.da...@gmail.com on 12 Mar 2010 at 7:47

GoogleCodeExporter commented 9 years ago
What is the exact error (as reported by ResponseString of the 
GDataRequestException class? This code above is 
pretty much part of the unittests and works fine for me.

Original comment by fman...@gmail.com on 18 Mar 2010 at 7:29

GoogleCodeExporter commented 9 years ago
The lines I pasted are copy & paste of the exception message.
What I wrote in the brackes is just what the Hebrew message is
since my windows is in Hebrew   

Original comment by roi.da...@gmail.com on 18 Mar 2010 at 8:00

GoogleCodeExporter commented 9 years ago
sure. I understand that. But, what you should be doing is:

try
{
Feed<Contact> fc = cr.Get<Contact>(cq);
foreach (Contact c in fc.Entries)
{
  //do stuff
}}
catch (GDataRequestException e)
{
    look at e.ResponseString
}

as outlined in the error handling topic of the help file

Frank

Original comment by fman...@gmail.com on 18 Mar 2010 at 8:52

GoogleCodeExporter commented 9 years ago
Oh ok.
I get invalid value for group parameter: Contacts

Original comment by roi.da...@gmail.com on 19 Mar 2010 at 7:33

GoogleCodeExporter commented 9 years ago
From the documentation:

group   Constrains the results to only the contacts belonging to the group 
specified. Value of this parameter 
specifies group ID (see also: gContact:groupMembershipInfo).

I have no idea (ask in the contacts group) what the group ID for the mycontacts 
group is, but that parameter 
is probably just wrong.

Did you actually try to use the groups query? 

Frank

Original comment by fman...@gmail.com on 19 Mar 2010 at 1:39

GoogleCodeExporter commented 9 years ago
Yes I tried. I get strings with "System group"

just the api specify
http://code.google.com/apis/contacts/docs/2.0/reference.html#GroupElements

System group id Meaning
"Contacts"  The My Contacts system group.
"Friends"   The Friends system group.
"Family"    The Family system group.
"Coworkers" The Coworkers system group.

maybe I'll try the long string I get when I query the groups titles.

Roi

Original comment by roi.da...@gmail.com on 20 Mar 2010 at 6:29

GoogleCodeExporter commented 9 years ago
Did you ask in the contacts discussion group? Right now it looks to be more 
like an
issue of "how" to do that, than a bug in the .net api per se....

Original comment by fman...@gmail.com on 22 Mar 2010 at 3:20

GoogleCodeExporter commented 9 years ago
I got this from the contacts support guys:

This is not supported by the feed:

http://www.google.com/m8/feeds/contacts/default/full?group=Contacts 

The group must be a groupId, they need to query first the groups feed and look 
for
the appropriate name, maybe is a good Idea to have a wrapper to let user query 
the
main groups directly.

Original comment by fman...@gmail.com on 23 Mar 2010 at 5:27