This documentation is for WSO2 Enterprise Integrator version 6.1.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

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

Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation:

  • <PRODUCT_HOME>/repository/samples/ directory that includes all Integration profile samples is changed to <EI_HOME>/samples/service-bus/.
  • <PRODUCT_HOME>/repository/samples/resources/ directory that includes all artifacts related to the Integration profile samples is changed to <EI_HOME>/samples/service-bus/resources/.


This sample demonstrates how a proxy service can be exposed on a subset of available transports and how it could switch from one transport to another.


For a list of prerequisites, see Prerequisites to Start the ESB Samples.

Building the sample

The XML configuration for this sample is as follows: 

<definitions xmlns="">
    <proxy name="StockQuoteProxy" transports="https">
                <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="pox"/>
                <property name="messageType" value="text/xml" scope="axis2"/>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>

This configuration file  synapse_sample_152.xml is available in the <ESB_HOME>/repository/samples directory.

To build the sample

  1. Start the ESB with the sample 152 configuration. For instructions on starting a sample ESB configuration, see Starting the ESB with a sample configuration.

    The operation log keeps running until the server starts, which usually takes several seconds. Wait until the server has fully booted up and displays a message similar to "WSO2 Carbon started in n seconds."

  2. Start the Axis2 server. For instructions on starting the Axis2 server, see Starting the Axis2 server.

  3. Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, see Deploying sample back-end services.

Executing the sample

The sample client used here is the Stock Quote Client, which can operate in several modes. For further details on this sample client and its operation modes, see Stock Quote Client.

To execute the sample client

  • Run the following command from the <ESB_HOME>/samples/axis2Client directory.

    ant stockquote -Dtrpurl=https://localhost:8243/services/StockQuoteProxy

Analyzing the output

This example exposes the created proxy service only on HTTPS. Therefore, if you try to access it over HTTP, it would result in a fault.

ant stockquote -Dtrpurl=http://localhost:8280/services/StockQuoteProxy
     [java] org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR) /services/StockQuoteProxy

Accessing this over HTTPS using the command ant stock quote -Dtrpurl= href="https://localhost:8243/services/StockQuoteProxy">https://localhost:8243/services/StockQuoteProxy causes the proxy service to access the SimpleStockQuoteService on the sample Axis2 server using REST/POX.

If you capture the message exchange using TCPMon, you will see that the REST/POX response is transformed back into a SOAP message and returned to the client as follows:

POST http://localhost:9000/services/SimpleStockQuoteService HTTP/1.1
SOAPAction: urn:getQuote
Content-Type: application/xml; charset=UTF-8;action="urn:getQuote";
Transfer-Encoding: chunked
Connection: Keep-Alive
User-Agent: Synapse-HttpComponents-NIO

<m0:getQuote xmlns:m0="http://services.samples/xsd">
HTTP/1.1 200 OK
Content-Type: application/xml; charset=UTF-8;action="http://services.samples/SimpleStockQuoteServicePortType/getQuoteResponse";
Date: Tue, 24 Apr 2007 14:42:11 GMT
Server: Synapse-HttpComponents-NIO
Transfer-Encoding: chunked
Connection: Keep-Alive

<ns:getQuoteResponse xmlns:ns="http://services.samples/xsd">
      <ns:lastTradeTimestamp>Tue Apr 24 20:42:11 LKT 2007</ns:lastTradeTimestamp>
      <ns:name>IBM Company</ns:name>
  • No labels