aspose file tools*
The moose likes Web Services and the fly likes Receiving HTTP 405 When trying to use Jersey Client to Process POST to Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Receiving HTTP 405 When trying to use Jersey Client to Process POST to Web Service" Watch "Receiving HTTP 405 When trying to use Jersey Client to Process POST to Web Service" New topic
Author

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

James Dekker
Ranch Hand

Joined: Dec 09, 2006
Posts: 219
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

Joined: Mar 24, 2005
Posts: 186
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?
 
wood burning stoves
 
subject: Receiving HTTP 405 When trying to use Jersey Client to Process POST to Web Service