This documentation is for WSO2 Enterprise Service Bus version 4.8.1 . View documentation for the latest release.

All docs This doc

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Objective: Introduction to ESB Proxy Services.

Code Block
<definitions xmlns="">
    <proxy name="StockQuoteProxy">
                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
  • Start the Synapse configuration numbered 150: i.e. -sn 150
  • Start the Axis2 server and deploy the SimpleStockQuoteService if not already done.

Once ESB starts, you could go to http://localhost:8280/services/StockQuoteProxy?wsdl and view the WSDL generated for the Proxy Service defined in the configuration. This WSDL is based on the source WSDL supplied in the Proxy Service definition and is updated to reflect the Proxy Service EPR.

Execute the stock quote client by requesting for a stock quote on the Proxy Service as follows:

1. Stock Quote Client

This is a simple SOAP client that could send stock quote requests, and receive and display the last sale price for a stock symbol.

The client is able to operate in the following modes, and send the payloads listed below as SOAP messages:

  • quote - sends a quote request for a single stock as follows. The response contains the last sales price for the stock which would be displayed.
Code Block
<m:getQuote xmlns:m="http://services.samples/xsd">
  • customquote - sends a quote request in a custom format. The ESB would transform this custom request into the standard stock quote request format and send it to the service. Upon receipt of the response it would be transformed again to a custom response format and returned to the client, which will then display the last sales price.
Code Block
<m0:checkPriceRequest xmlns:m0="http://services.samples/xsd">
  • fullquote - gets quote reports for the stock over a number of days (i.e. last 100 days of the year).
Code Block
<m:getFullQuote xmlns:m="http://services.samples/xsd">
  • placeorder - places an order for stocks using a one way request
Code Block
<m:placeOrder xmlns:m="http://services.samples/xsd">
  • marketactivity - gets a market activity report for the day (i.e. quotes for multiple symbols)
Code Block
<m:getMarketActivity xmlns:m="http://services.samples/xsd">

See samples/axis2Client/src/samples/common/ for sample responses expected by the clients.

Code Block
ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy

An inSequence or endpoint or both of these would decide how the message would be handled after the Proxy Service receives the message. In the above example the request received is forwarded to the sample service hosted on Axis2. The outSequence defines how the response is handled before it is sent back to the client. By default, a Proxy Service is exposed over all transports configured for ESB, unless these are specifically mentioned through the transports attribute.


Examples connected with proxy services.