Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jquery POST XML to Rest service  RSS feed

 
G Peruana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to send a POST request to a Restful service with jquery, where the type of data sent is xml.

The Rest service works since I tested it from Chrome Rest plugin. I made it work for GET XML, GET JSON and POST JSON, but no way with POST XML.

Here goes the code. I do not get any error, but the invocation does not succeeds:



Thanks a lot for your help!!
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for error function, put another alert to see what value (http status code)

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
alerts are an incredibly antiquated and inefficient way to debug. Learn to use the browser's debugger to set breakpoints and to log to the JavaScript console.

 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A very helpful tool to use is TCP/IP mon.
You can see exactly the request from the client and response from the server.
Especially, the headers value from the request and response.
Every thing will be solved from there on.

It's a matter of patience and take time to debug to understand what is. Good luck.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
H Paul wrote:A very helpful tool to use is TCP/IP mon.

Again, all of the modern browsers have tools such as this built right in. Anyone working on the web needs to familiarize themselves with these tools.
 
H Paul
Ranch Hand
Posts: 491
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If allowed, you're BIG Bear. :-D
 
G Peruana
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I used chrome debugger.

Finally it was a missing comma.

Thanks a lot for your comments.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!