Hi,
I have created the Google Base and it stopped working. I have been
trying since three months to fix this issue but no success...
The code is shown below...
If any mistakes please let me know and advise...
Dim gbase_applicationName As String = "Base test"
Dim gbase_applicationKey As String = Appkey.Text
Dim gbase_userName As String = "[email protected]"
Dim gbase_password As String = "Password"
Dim i As Integer
i = 102
Dim service As GBaseService = New GBaseService
(gbase_applicationName, gbase_applicationKey)
service.setUserCredentials(gbase_userName, gbase_password)
Dim query As GBaseQuery = New GBaseQuery("http://
base.google.com/base/feeds/items")
Dim feed As GBaseFeed = service.Query(query)
service.setUserCredentials(gbase_userName, gbase_password)
Dim batchFeed As AtomFeed = New AtomFeed(feed)
'batchFeed = feed
batchFeed.BatchData = New GDataBatchFeedData
batchFeed.BatchData.Type = GDataBatchOperationType.insert
Dim entry As GBaseEntry = New GBaseEntry
Dim author As AtomPerson = New AtomPerson
author.Name = "Author"
entry.Authors.Add(author)
entry.BatchData = New GDataBatchEntryData
entry.BatchData.Id = i.ToString()
entry.GBaseAttributes.Price = New FloatUnit(Convert.ToSingle
(2.99), "GBP")
entry.GBaseAttributes.PriceUnits = "item"
entry.Content.Type = "text/html"
entry.Title.Text = "Testing how to add Items to GBase"
entry.Content.Content = "Content"
entry.GBaseAttributes.AddTextAttribute("Condition", "New")
entry.GBaseAttributes.ItemType = "products"
Dim lnk As New AtomLink
lnk.HRef = New AtomUri("http://example.com")
lnk.Rel = "alternate"
lnk.Dirty = False
lnk.Type = "text/html"
entry.Links.Add(lnk)
lnk = Nothing
entry.BatchData.Type = GDataBatchOperationType.insert
batchFeed.Entries.Add(entry)
' upload
Dim returnFeed As GBaseFeed = service.Batch(batchFeed, New Uri
(batchFeed.Batch))
For Each entry1 As GBaseEntry In returnFeed.Entries
If entry1.BatchData.Status.Code > 300 Then
'lblMsg.Text = "errors encountered"
Exit Sub
End If
Next
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Base 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-Base-data-API?hl=en
-~----------~----~----~----~------~----~------~--~---