File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Receiving HTTP 405 When trying to use Jersey Client to Process POST to Web Service

 
James Dekker
Ranch Hand
Posts: 221
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JDK 1.6, Jersey, & Jersey Client to post a JSON String to a web service running on my local tomcat container.





What can I be doing wrong? Thank you for taking the time to read this...

-James
 
Emanuel Kadziela
Ranch Hand
Posts: 187
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, it seems that the code you listed does not match the output you listed. I don't see anywhere in the code where you print out the JSON String, yet this appears in the output "JSON String: {"qty":100,"name":"iPad 4"} ".

Secondly, 405 errors have to do with method mismatches (like trying to send a POST request to a server that only allows GET requests). Are you sure your server is set up to accept and process POST requests?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic