This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Message Exchange between the Client and Proxy Services
Objective: Demonstrate the Reliable Message exchange between the client and ESB using WS-ReliableMessaging (WS-RM).
Prerequisites:
- Deploy the SimpleStockQuoteService in the sample Axis2 server and start it on port 9000.
- Start ESB with the sample configuration number 201 (i.e.
wso2esb-samples -sn 201
).
<definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="StockQuoteProxy"> <target> <inSequence> <header name="wsrm:SequenceAcknowledgement" action="remove" xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/> <header name="wsrm:Sequence" action="remove" xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm"/> <send> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService"/> </endpoint> </send> </inSequence> <outSequence> <send/> </outSequence> </target> <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/> <enableRM/> </proxy> </definitions>
In the configuration, a Proxy Service is created with WS-RM enabled using the <enableRM/
> element. Therefore, this Proxy Service is capable of communicating with a WS-RM client. It also removes the WS-RM headers in the InSequence
before the message is sent to the backend server. This is required as the Reliable Messaging is applicable only between the client and ESB.
Start the client with WS-RM as follows:
ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dwsrm=true
In this case, client sends WS-RM enabled request to ESB where ESB sends normal request to the server. This can be observed by examining the wire level messages between the client and ESB. These messages would be similar to the wire level messages shown in sample Message Exchange between ESB and Server.