3 messages in com.googlegroups.google-base-data-apiRe: Service not found error executing...| From | Sent On | Attachments |
|---|---|---|
| jav developer | 10 Jul 2007 13:18 | |
| Jeff S | 10 Jul 2007 17:54 | |
| jav developer | 11 Jul 2007 04:02 |
| Subject: | Re: Service not found error executing InsertExample.java![]() |
|---|---|
| From: | jav developer (hedi...@gmail.com) |
| Date: | 07/11/2007 04:02:12 AM |
| List: | com.googlegroups.google-base-data-api |
Hi Jeff
I try with the changes that you suggested and know is returning and empty error string, also I ran the original code with the basic xml and also returned the Service not found error. I was wondering if there is another way to execute a xml feed with the google api?
On Jul 10, 8:55 pm, Jeff S <j....@google.com> wrote:
Hi JDV,
I think that the reason this fails is because the InsertExample.java program sends the XML to the normal items feed (http://base.google.com/ base/feeds/items) but the batch URL needs to be used for batch requests. There are some details here:
http://code.google.com/apis/gdata/batch.html#Submit_HTTP
From the above page, it looks like the batch URL is
http://www.google.com/base/feeds/items/batchso I think you can get the insert example to do a batch request with a few changes.
1. Define a constant for the the batch URL. private static final String BATCH_FEED = "http://base.google.com/base/ feeds/items/batch";
2. Change the connection's endpoint in postItem() HttpURLConnection connection = (HttpURLConnection)(new URL(BATCH_FEED)).openConnection();
Let me know how it goes and happy coding,
Jeff
On Jul 10, 1:19 pm, jav developer <hedi...@gmail.com> wrote:
Hi, I'm receiving the following error: <errors> <error type="request" reason="Service not found"/> </errors>
That is after running the code of InsertExample.java source code, also I was wandering if I could use that code with the following XML text (for batch operations, the xml was taken from a google batch example ):
<?xml version='1.0' encoding='UTF-8'?> <feed xmlns='http://www.w3.org/2005/Atom' xmlns:g='http://base.google.com/ns/1.0' xmlns:batch='http://schemas.google.com/gdata/batch'> <entry> <batch:id>itemA</batch:id> <batch:operation type='insert'/> <author> <name>Jane Doe</name> <email>Jane...@gmail.com</email> </author> <title type="text">Marie-Louise's chocolate butter</title> <content type="xhtml"> <b>Ingredients:</b> <ul> <li>250g margarine,</li> <li>200g sugar,</li> <li>2 eggs, and</li> <li>approx. 8 tsp cacao.</li> </ul> <p>Mix everything. Heat while stirring, but do not allow the mix to boil. Put in a container and cool in fridge.</p> </content> <g:item_language type="text">en</g:item_language> <g:item_type type="text">testrecipes</g:item_type> <g:cuisine type="text">danish</g:cuisine> <g:cooking_time type="intUnit">10 minutes</g:cooking_time> <g:main_ingredient type="text">cacao</g:main_ingredient> <g:main_ingredient type="text">margarine</g:main_ingredient> <g:serving_count type="int">4</g:serving_count> </entry> </feed>
Regards JDV




