Hi,
The batch.id is the product ID but however, I have added the ID as the
attribute now...
I tested the code and I get this error
400 Bad Request
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 31 Mar 2009 19:28:37 GMT
Expires: Tue, 31 Mar 2009 19:28:37 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
Server: GFE/2.0

<Content is not allowed in prolog.

any suggestions

On Mar 31, 6:28 pm, Alex <[email protected]> wrote:
> The items must have item-type "Products" if they should be searchable
> usinghttp://www.google.com/products. And products have special restricts.
> Read the following:http://code.google.com/apis/base/starting-out.html#products
>
> The server tells you why the requests fail. Try to see what the Base API
> server
> returns, instead of just blindly relying on a library (that most probably
> takes the
> errors and dismisses them).
>
> One more piece of advice: the demo page is your friend if you want to see
> that what you insert contains the right attributes. So, try to insert an
> item
> using the demo page and see what results you get back.
>
> After looking at your code, it seems you don't specify the g:id attribute.
> Meaning you don't have a g:id set.
>  entry.GBaseAttributes.AddTextAttribute("id",
> and_here_goes_your_unique_item_id);
>
> But I can't say for sure, because it's
> way harder reading some code that uses a library I don't know than just
> reading the XML that gets sent to the Base API server.
>
> Alex
>
>
>
>
>
> On Mon, Mar 30, 2009 at 10:58 PM, Support <[email protected]> wrote:
>
> > hi,
> > Thanks for the info given... but however i have read them all and none
> > of them help...
> > however, if sum1 cud please execute or read the below code and tell me
> > what is wrong with this...
> > plz help I have been trying everyfin since the  past two weeks but the
> > items wont upload only if the item type is products
> > Thanks in advance for all replies :)))
> > code--------------
>
> > GBaseService service = new GBaseService("PC24UK",google_key);
> >        service.setUserCredentials(username,password);
> >        GBaseQuery query = new GBaseQuery("http://www.google.com/base/
> > feeds/items/ <http://www.google.com/base/%0Afeeds/items/>");
> >        GBaseFeed feed = service.Query(query);
> >        AtomLink lnk;
> >        AtomFeed batchFeed = new AtomFeed(feed);
> >        batchFeed.BatchData = new GDataBatchFeedData();
> >        batchFeed.BatchData.Type = GDataBatchOperationType.insert;
> >        GBaseEntry entry;
> >        AtomPerson author;
> >        author = new AtomPerson();
> >        author.Name = "Amjad";
>
> >        entry = new GBaseEntry();
> >        entry.BatchData = new GDataBatchEntryData();
> >        entry.Authors.Add(author);
> >         entry.BatchData.Id = "ab08791885";
> >        entry.Language = "en";
> >         entry.GBaseAttributes.AddTextAttribute("target country",
> > "GB");
> >        entry.GBaseAttributes.Price = new FloatUnit(Convert.ToSingle
> > (1.99), "GBP");
> >        entry.Title.Text = "ADSL";
> >        entry.Content.Content = "5 Port ADSL Router";
> >        entry.GBaseAttributes.ItemType = "Products";
>
> >        entry.GBaseAttributes.Quantity = 100;
> >        entry.GBaseAttributes.AddTextAttribute("Condition", "New");
> >         entry.GBaseAttributes.AddTextAttribute("Brand", "TPLink");
> >        entry.GBaseAttributes.AddImageLink("http://pc24uk.com/code/prd/
> > img/prdlarge/2-V303.gif<http://pc24uk.com/code/prd/%0Aimg/prdlarge/2-V303.gif>
> > ");
>
> >        lnk = new AtomLink();
> >        lnk.HRef = new AtomUri("http://pc24uk.com/code/frogsearch.aspx?
> > skus=2-V303 <http://pc24uk.com/code/frogsearch.aspx?%0Askus=2-V303>");
> >         lnk.Rel = "alternate";
> >        lnk.Dirty = false;
> >        lnk.Type = "text/html";
> >        entry.Links.Add(lnk);
> >        lnk = null;
> >        entry.BatchData.Type = GDataBatchOperationType.insert;
>
> >        batchFeed.Entries.Add(entry);
> >        AtomFeed returnFeed = service.Batch(batchFeed, new Uri
> > (batchFeed.Batch));
>
> > On Mar 30, 7:31 am, Celebird <[email protected]> wrote:
> > > verify the website itself, the item landing-page,
> > > and the items' supply-chain, each comply with all
> > > google-base requirements, rules, regulations and
> > > policies for the products item-type.
>
> > > see also:
> >http://base.google.co.uk/support/bin/answer.py?answer=61118http://bas...
>
> --
> Alex Dovlecel, Google Switzerland GmbH
> Company Identifikationsnummer: CH-020.4.028.116-1- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to