javaspring-bootsoapspring-ws

No endpoint mapping found for [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}UpdateXXXRequest]


I upgraded an old application which exposes 6 different SOAP web services with different namespaces. Everything seems working correctly when we use endpoints taken through its generated wsdl.

here is a sample request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:pres="http://MY_NAMESPACE.com">
   <soapenv:Body>
      <pres:UpdateXXXRequest>
      </pres:UpdateXXXRequest>
   </soapenv:Body>
<soapenv:Envelope>

but there are some clients which send request in following format

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:pres="http://MY_NAMESPACE.com">
   <soapenv:Body>
      <q0:UpdateXXXRequest xmlns:q0="http://schemas.xmlsoap.org/soap/envelope/">
      </q0:UpdateXXXRequest>
   </soapenv:Body>
<soapenv:Envelope

this request couses error No Endpoint Found due to the namespace xmlns:q0="http://schemas.xmlsoap.org/soap/envelope/" used with payload UpdateXXXRequest.

According to my analysis, Spring framework uses EndpointMapping to identify the respective method and then makes a call to the service based on namespace (either given with body payload q0:UpdateXXXRequest xmlns:q0="http://schemas.xmlsoap.org/soap/envelope/" or from soapenv:Envelop)

In case of {http://schemas.xmlsoap.org/soap/envelope/}UpdateRxFillRequest it its failed because method is defined with its own namespace and spring only looks for namespace defined with method through @Payload annotation.

if it remove q0 from UpdateXXXRequest or use the actual namespace it works fine but clients are sending the request with http://schemas.xmlsoap.org/soap/envelope/

What can be the way to support http://schemas.xmlsoap.org/soap/envelope/ & http://MY_NAMESPACE.com for each method.

although I have 100+ endpoints.


Solution

  • I am able to fix the issue by replacing @Payload annotation on SOAP method with @Payloads which allows to add multiple @Payload annotations. I added two one with service namespace as http://MY_NAMESPACE.com and second with http://schemas.xmlsoap.org/soap/envelope/. And spring framework recognized the SOAP endpoint with both annotations.