Converting an Axis2 web service to Spring-WS
Hello Spring Gurus,
I have a need to convert an existing Axis2 web service to Spring-WS. Moreover, I need to do this without causing any changes to the clients - so this is a bit of "reverse" web service coding.
Still, I thought "Simple! I have the contract (WSDL), as long as my Spring-WS web service adheres to the contract, all will be right with the world!". Easier said than done.
So here is where I stand:
I have a simple WSDL that was originally generated by Axis2.
I implemented the web service in Spring-WS.
I map urls of the type "/axis2/service/*" to the MessageDispatcherServlet so that existing clients can continue sending requests to the same url.
What I noticed that my axis2 client is sending the message in the following format (neither of which looks compatible with PayloadRootQNameEndpointMapping or SoapActionEndpointMapping). The following is the http post as sent from the client, along with the response from the server:
Code:
POST /axis2/services/GeneralService HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getServerVersion"
User-Agent: Axis2
Host: 127.0.0.1:8080
Transfer-Encoding: chunked
93
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body /></soapenv:Envelope>"
0
HTTP/1.1 400 No Host matches server name 127.0.0.1
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
Date: Fri, 30 Oct 2009 17:25:45 GMT
Connection: close
0
As you can see in the request message, there is nothing in the SOAP:Body payload, and also no SOAP Action header. The action is defined as part of the Content-Type http header. What kind of EndpointMapping should be used to process this message?
Thanks!