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

All docs This doc
Skip to end of metadata
Go to start of metadata

After setting up the samples, you can use the sample clients to run them. The sample clients can be executed from the <ESB_HOME>/samples/axis2Client directory through the provided Ant script. Simply executing ant displays the available clients and some of the sample options used to configure them.

Following is more information about each of the sample clients. For details on using a sample client to run a specific sample, go to Samples and click the link for the sample you want to run.

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.

ant stockquote [\-Dsymbol=IBM|MSFT|SUN|..]
[\-Dmode=quote |customquote|fullquote | placeorder | marketactivity]
[&#45;Dtrpurl=http://localhost:8280/&#124;\||] [&#45;Dprxurl=http://localhost:8280/&#124;\||]

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.
<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.
<m0:checkPriceRequest xmlns:m0="http://services.samples/xsd">
  • fullquote - Gets quote reports for the stock over a number of days (for example, last 100 days of the year).
<m:getFullQuote xmlns:m="http://services.samples/xsd">
  • placeorder - Places an order for stocks using a one way request.
<m:placeOrder xmlns:m="http://services.samples/xsd">
  • marketactivity - Gets a market activity report for the day (for example, quotes for multiple symbols).
<m:getMarketActivity xmlns:m="http://services.samples/xsd">

Smart client mode

The addurl property sets the WS-Addressing EPR, and the trpurl sets a transport URL for a message. Thus by specifying both properties, the client can operate in the smart client mode, where the addressing EPR could specify the ultimate receiver, while the transport URL set to the ESB ensures that any necessary mediation takes place before the message is delivered to the ultimate receiver. For example:

ant stockquote -Daddurl=<addressingEPR> -Dtrpurl=<esb>

Gateway / dumb client mode

By specifying only a transport URL, the client operates in the dumb client mode, where it sends the message to the ESB and depends on the ESB rules for proper mediation and routing of the message to the ultimate destination. For example:

ant stockquote -Dtrpurl=<esb>

Proxy client mode

In this mode, the client uses the prxurl as an HTTP proxy to send the request. Thus by setting the prxurl to the ESB, the client could ensure that the message would reach the ESB for mediation. The client could optionally set a WS-Addressing EPR if required. For example:

ant stockquote -Dprxurl=<esb> [-Daddurl=<addressingEPR>]

Specifying a policy

By specifying a WS-Policy using the policy property, QoS aspects such as WS-Security could be enforced on the request. The policy specifies details such as timestamps, signatures, and encryption.

Generic JMS client

The JMS client is able to send plain text, plain binary content, or POX content by directly publishing a JMS message to the specified destination. The JMS destination name should be specified with the jms_dest property. The jms_type property could specify text, binary or pox to specify the type of message payload.

The plain text payload for a text message can be specified through the payload property. For binary messages, the payload property would contain the path to the binary file. For POX messages, the payload property will hold a stock symbol name to be used within the POX request for stock order placement request. For example:

ant jmsclient -Djms_type=text -Djms_dest=dynamicQueues/JMSTextProxy -Djms_payload="24.34 100 IBM"
ant jmsclient -Djms_type=pox -Djms_dest=dynamicQueues/JMSPoxProxy -Djms_payload=MSFT
ant jmsclient -Djms_type=binary -Djms_dest=dynamicQueues/JMSFileUploadProxy


The JMS client assumes the existence of a default ActiveMQ (5.2.0) installation on the local machine.

MTOM / SwA client

The MTOM / SwA client can send a binary image file as a MTOM or SwA optimized message, and receive the same file again through the response and save it as a temporary file. The opt_mode can specify mtom or swa respectively for the above mentioned optimizations. Optionally, the path to a custom file can be specified through the opt_file property, and the destination address can be changed through the opt_url property if required. For example:

ant optimizeclient -Dopt_mode=[mtom | swa]
  • No labels