A HTTP Proxy Service -> JMS Business Service -> Queue -> JMS Proxy Service -> HTTP Business Service.
I start with the WSDL which has two operations execute and callback.
The execute operation is used in the HTTP Proxy Service and the callback operation in the HTTP Business Service. The HTTP Proxy Service does the following:
- retrieves the Addressing MessageID from the header, $header/wsa05:MessageID/text() , In this case you need to use the 2005 / 08 addressing.
- retrieves the Addressing Reply URL from the header, $header/wsa05:ReplyTo/wsa05:Address/text(). This URL will be used in the callback HTTP Business Service
- Make a new Body for the Queue which contains the WS Request and the Reply URL
- Set the JMS CorrelationID with MessageID as value, use the Transport Header activity
- Call the JMS Business Service.
The JMS Queue has the following exception properties, these settings are very important else you can create a loop when something goes wrong, with these settings the message will be moved to the error queue when the dequeue proxy service fails twice.
The JMS Dequeue Proxy Service steps:
- Dequeue the JMS Message
- Retrieves the Addressing MessageID from the JMS header, $inbound/ctx:transport/ctx:request/tp:headers/jms:JMSCorrelationID/text()
- Retrieves the ReplyURL from the body
- Replace the header with this one <wsa05:RelatesTo>{$messageId}</wsa05:RelatesTo>
- Set the URL with the ReplyURL value, set the URL in the Routing Options activity.
- Call the HTTP Business Service.
Deploy everything to the OSB Server and start SOAPUI so you can test this OSB project.
In SOAPUI you can import the WSDL of the HTTP Proxy Service. I will use the execute operation as test and make a mock service based on the callback operation.
Start the mockservice and remember the url of this mock service
Create a request and enable WS-Adressing, put the mockservice url in the Reply To field and enable Randomly generate MessageId
The OSB will call your mock service with the response and uses RelatesTo element which contains the MessageId of the request.
Here you got the OSB export of my test project.