This documentation is for WSO2 ESB version 4.6.0. View documentation for the latest release.
Skip to end of metadata
Go to start of metadata

Objective: Introduction to ESB Proxy Services.

Prerequisites
  • Start the Synapse configuration numbered 150: i.e. wso2esb-samples.sh -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.
  • 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.
  • fullquote - gets quote reports for the stock over a number of days (i.e. last 100 days of the year).
  • placeorder - places an order for stocks using a one way request
  • marketactivity - gets a market activity report for the day (i.e. quotes for multiple symbols)
Note

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

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.

Labels
  • None