Hi,
I access a web service with SOAP 1.2 via HTTP 1.1. I used wsimport on the WSDL to generate the stubs (I only use Java 6).
The web service is a php-Script running on a web server (maybe delegates this in the background, I have no access nor intimate knowledge of the server). This script provides both the WSDL (via GET) and the service (via POST). When I use my generated client I always end up with the same exception:
Exception in thread "main" com.sun.xml.ws.streaming.XMLStreamReaderException: unexpected XML tag. expected: {http://www.w3.org/2003/05/soap-envelope}Envelope but found: {http://schemas.xmlsoap.org/wsdl/}definitions
at com.sun.xml.ws.streaming.XMLStreamReaderUtil.verifyTag(XMLStreamReaderUtil.java:203)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:186)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:163)
at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:135)
at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:294)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:173)
at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:88)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
at com.sun.xml.ws.client.Stub.process(Stub.java:248)
at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:134)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:244)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
at $Proxy45.hello(Unknown Source)
at client.Client.main(Client.java:37)
The exception occurs in the line with the first use of a service method. Somehow the service seems to issue a GET rather than a POST and ends up requesting the WSDL file which generates parsing errors.
So the code looks something like this:
Service service = new Service();
ServicePort port = service.getServicePort();
port.soSomething(); // <- exception
The conversation is SSL encrypted so I can't look at the conversation in Wireshark or similar tools. Maybe there is a problem because the same URL is used for both WSDL and SOAP?