Problems

Discussions

XML & Web services: Problems

  1. Problems (2 messages)

    I've posted this on a couple of other forums sites, but didn't seem to get any replies. I was wondering if anyone here could help me.

    I am working my way through the Web Services in a Nutshell book from O'Reilly. To demonstrate SAAJ, there is a very simple example named SAAJEchoService, which should simply echo the incoming SOAP message back to the originator.

    The client code is simply:
    [code]
    MessageFactory messageFactory =
        MessageFactory.newInstance();
    SOAPMessage message = messageFactory.createMessage();
    SOAPConnectionFactory connFactory =
        SOAPConnectionFactory.newInstance();
    SOAPConnection conn = connFactory.createConnection();
    SOAPMessage reply = conn.call(message, args[0]);
    [/code]

    However, I am getting the following error:
    [code]
         [java] Oct 1, 2004 4:15:50 PM 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] at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:285)
         [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$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:44)
         [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:44)
         [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
    [/code]

    There seems to be something wrong with HttpSOAPConnection, in that it is initiating a GET transaction when it should be using a POST transaction. The servlet it connects to only supports doPost, hence the error message. Has anyone else been looking at this book, and managed to get the example to work? Thanks, Neil
  2. Oops. Title of thread should have been 'Problems with com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection'
  3. I encountered the exact same problem when I try to execute the client code. I have send the question to the bookquestion email and if I can get any feedback from them (hopefully), I will let you know.

    Shiwan