3 messages in com.googlegroups.google-base-data-apiBad Request exception thrown on inser...| From | Sent On | Attachments |
|---|---|---|
| Srikanth | 10 Nov 2006 13:09 | |
| Stephane Zermatten | 12 Nov 2006 23:24 | |
| Nate_Frog | 02 Dec 2006 08:44 |
| Subject: | Bad Request exception thrown on insert sample![]() |
|---|---|
| From: | Srikanth (srik...@gmail.com) |
| Date: | 11/10/2006 01:09:07 PM |
| List: | com.googlegroups.google-base-data-api |
Hi,
I am trying out the GBase API using the sample from the docs for inserting. I am getting an exception, cannot figure out what the problem is, cannot make out why this is a bad request. The code is verbatim from the sample; Help will be greatly appreciated. The code snippet and exception are below:
Caught Exception:Execution of request failed: http://www.google.com/base/feeds/items; InnerException: System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Google.GData.Client.GDataRequest.Execute(); Data: System.Collections.ListDictionaryInternal; Source: gdata
try {
GBaseService service = new GBaseService("Insert/Update test", DevKey); service.setUserCredentials(username, passwd); Console.WriteLine("Got a service"); GBaseEntry entry = new GBaseEntry(); entry.Title.Text = "My House"; entry.Content.Content = "The best house of the area."; entry.GBaseAttributes.ItemType = "test"; entry.GBaseAttributes.AddTextAttribute("my attribute", "hello"); entry.GBaseAttributes.AddFloatAttribute("bathrooms", 2f); entry.GBaseAttributes.AddFloatAttribute("rooms", 6.5f); entry.GBaseAttributes.AddFloatAttribute("bedrooms", 2f); entry.GBaseAttributes.Location = "1900 Snow Cone Avenue, North Pole";
Console.WriteLine("Just before inserting");
GBaseEntry myEntry = service.Insert(GBaseUriFactory.Default.ItemsFeedUri, entry); } catch (Exception ex) { Console.WriteLine("Caught Exception:"+ ex.Message+"; InnerException: "+ex.InnerException+"; Data: "+ex.Data+"; Source: "+ex.Source); }




