File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GET instead of POST?

 
Neil Laurance
Ranch Hand
Posts: 183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic