3. Service-C ("Asynchronous request-response" service )
Service C is a legacy service that takes an input from a client , process it and then response back to the same client (by default ). However your business is in such a way that your response should not go to the initial caller(Service-A) but to another process(Service-B). Depicted below is the same:
For this , you may need to tweak the SOAP Headers / WS-Adressing properties by sending the WSA ReplyTo to the Service-C's URI in the call from Service-A to Service-C.
ie., The Service-C's input looks like this:
<span style="font-weight:bold;"> <soap:Header xmlns:ns1="http://schemas.xmlsoap.org/ws/2003/03/addressing">
</span> <soap:Body xmlns:ns1="http://xmlns.oracle.com/TestApplication_jws/SOATestProject/MyAsynchronousService">
As you see we give the Service-B's WSDL(http://localhost:8001/soa-infra/services/default/SOATestProject/ServiceB?WSDL) in the Reply To tag.
However care has to be taken while creating Service B that you use the same port type and message types that Service C uses to callback. Otherwise you may end up with exception : javax.xml.ws.soap.SOAPFaultException: oracle.fabric.common.FabricException: Unable to find operation: null
Not changing your legacy Asynchronous request/response service,you can route the call back response to another service apart from the caller using WS-Addressing.