1

for some reason (retro-compatibility to old software) I need to deploy 3 different web services where the request has no namespace and have the same local part di the request:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <OrdersRequest>
          ...
        </OrdersRequest>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

My actual code is deployed using @Endpoint annotation and a method with logic that is managed by @PayloadRoot( localPart = "OrdersRequest" , namespace = NAMESPACE_URI) annotation.

My problem is that if I deployed a second method (on each web service) and I annotate with @PayloadRoot( localPart = "OrdersRequest" ) there is not way to differentiate between request that comes from webservice1 from webservice2 and from webservice3.

Obviously if I try to add @PayloadRoot( localPart = "OrdersRequest" ) on all 3 web services Spring crash at runtime because a key with localPart = "OrdersRequest" is already present.

One option could be to deploy 3 web services with "same request" beyond different URLs but I didn't found a way to do this with SoapServices.

A second option could be to write custom PayloadRootAnnotationMethodEndpointMapping following this thread How can i have two separate web services with identical name space and local name requests be routed to different end points? but I'm not able to "transform" that solution from xml files to annotation

Third option could be intercept the request before rout to endpoint in order to override empty namespaces with the correct one (based on the path of the request) but again I didn't found a way to do this. I tried with EndpointInterceptor but they are called after Spring found a "way" to route the request to the "correct" @PayloadRoot method and not before.

Any suggestions are welcome.

Andrea P
  • 11
  • 2

0 Answers0