Hello community, I am trying to create POI nodes from javascript using AJAX requests (via a proxy) to talk to the API. My code to create a node looks like this:
I call this with an action of "create" and the following XML for the node:
and it talks to my proxy which in turn talks to the API but instead of getting a new node ID back I get a message which reads:
Do you know this error ? Can anyone help ? If you need to see the site, it is at http://www.uni-pages.de/projects/osm/index.php and it is talking to the api06 test API. greets Christian |
I have stepped through your javascript in Firebug and traced the network traffic from my browser to your proxy, and from your proxy to the dev server and the problem seems to be with your proxy script. Although the XML which leaves the browser looks like what you showed in the question, what arrives at the server looks like this:
As you can see, your proxy has escaped all the quotes. That causes the XML to fail to parse and the server to return this error:
Unfortunately it looks like your proxy only returns the last line of that to the browser, hence the confusing error message in the browser. I would also add that passing the XML as a URL parameter to the proxy is not really a good idea - it would be better to use POST and pass it in the body. Indeed as creating a node is not idempotent you should be using POST rather than GET for that request anyway. answered 02 Feb '11, 01:01 TomH ♦♦ |