4 messages in com.googlegroups.google-base-data-apiC# Insert Example Not Working
FromSent OnAttachments
archis16 Jan 2008 07:22 
archis16 Jan 2008 09:09 
Jeff S16 Jan 2008 14:14 
Ivan18 Jan 2008 03:41 
Subject:C# Insert Example Not Working
From:archis (jbra@allegisgroup.com)
Date:01/16/2008 07:22:50 AM
List:com.googlegroups.google-base-data-api

Hi,

I'm trying to come up to speed on inserting items into google base from c#. I've copied google's example code, but I'm getting a "400 Bad Request" Error.

My developer key looks OK with the customer_tool program, but I can't insert items with the customer_tool either. From the customer_tool I get a "Stream does not support writing" error.

My GoogleBase and Google Client DLL's are version 1.1.2.

Any ideas on how to resolve this problem would be appreciated.

Thanks

P.S. Here my code:

GBaseService service = new GBaseService("Google-Tutorial-1.0", developerKey); GBaseQuery query = new GBaseQuer(GBaseUriFactory.Default.SnippetsFeedUri); service.setUserCredentials("myloging","mypwd"); 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"; GBaseEntry myEntry = service.Insert(GBaseUriFactory.Default.ItemsFeedUri, entry);