This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes GET instead of POST? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "GET instead of POST?" Watch "GET instead of POST?" New topic
Author

GET instead of POST?

Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
Hi, I've posted this question on Java Developer Connection's Forums, but no responses yet. Was wondering if anyone here could help me out?

I am running through the examples in the "Java Web Services in a NutShell" book.

I am using jwsdp-1.4 and tomcat-jwsdp-1.4.

I was trying the EchoService example, which sends an empty SOAP message to a servlet deployed in Tomcat. This servlet should then simply echo the message back to the sender.

However, when I attempt to run the example, I get the following error:

[java] Headers:
[java] Content-Type: text/xml; charset=utf-8
[java] Content-Length: 132
[java] SOAPAction: ""

[java] Message:
[java] <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body/></SOAP-ENV:Envelope>
[java] Using connection class com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection
[java] Sep 29, 2004 10:22:45 AM com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection post
[java] SEVERE: SAAJ0008: Bad Response; HTTP method GET is not supported by this URL
[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad response: (405HTTP method GET is not supported by this URL
[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad response: (405HTTP method GET is not supported by this URL
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:285)
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
[java] at ora.jwsnut.chapter3.client.EmptyMessageClient.main(EmptyMessageClient.java:41)
[java] java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad response: (405HTTP method GET is not supported by this URL
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
[java] at ora.jwsnut.chapter3.client.EmptyMessageClient.main(EmptyMessageClient.java:41)
[java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Bad response: (405HTTP method GET is not supported by this URL
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:285)
[java] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)
[java] ... 3 more

The error message seems to suggest that the HttpSOAPConnection class is getting confused between POST and GET modes. Or is there something I need to configure in my client code? Has anyone else seen / worked around this?

Thanks, Neil
 
wood burning stoves
 
subject: GET instead of POST?