Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Figure 1: Messaging Bridge EIP


Sample scenario

An enterprise might use more than one messaging system in communication. This example illustrates the ESB profile as a message bridge, which accepts a REST message from the client, transforms the REST message to SOAP format, and sends the SOAP message to the back-end Axis2 server. To transform the sent REST request to a SOAP message, we use the API functionality of the ESB profile. It restructures the message to a REST format using the Payload Factory mediator.  


Messaging Bridge EIP (Figure 1)Messaging Bridge Example Scenario (Figure 2)
Messaging System1Stock Quote client
Messaging BridgePayloadFactory Mediator (You can add any transformation mediator here. Also see Message Translator)
Messaging System2Stock Quote service

Environment setup


The ESB configuration

Given below is the ESB


ESB configuration

Start the ESB profile and log into its Management Console. For instructions, see Starting the ESB profile in WSO2 EI Documentation.

On the Management Console, navigate to the Main Menu and configuration of this sample. Log in to the Management Console of the ESB profile, click Main, and then click Source View in the Service Bus section. Copy and paste the following configuration to the source view. You can now explore the example scenario. menu to view this. 


Code Block
<!-- Message Translator-->
<definitions xmlns="">
   <api name="MessageTranslate" context="/stockquote">
      <resource methods="GET" uri-template="/view/{symbol}">
                  <m0:getQuote xmlns:m0="http://services.samples">
                  <arg expression="get-property('uri.var.symbol')"/>
            <property name="SOAPAction" value="getQuote" scope="transport"></property>
                  <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>

How the implementation works

Let's investigate the elements of the configuration in detail.

  • Payload Factory - Builds the necessary SOAP request for the back-end service. It uses the value of the HTTP GET variable (from the REST request made to the ESB profile).  
  • args - A list of arguments that will be concatenated in the same order inside the format tags (in a printf style).  

Simulating the sample scenario

Now, let's try out the sample explained above.

Setting up the environment

  1. Download and install the ESB profile of WSO2 Enterprise Integrator (EI). For a list of prerequisites and step-by-step installation instructions, go to Installing the Product in WSO2 EI Documentation.
  2. Start an instance of Sample Axis2 server. For instructions, go to Starting the Axis2 server in WSO2 EI Documentation.
  3. Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, go to Deploying sample back-end services in WSO2 EI Documentation.

Executing the sample

  1. Pass the following request to the ESB profile using the cURL client.
    curl -v
  2. You can use TCPMon to see the type of the message and its message format:

    Code Block
    GET /stockquote/view/IBM HTTP/1.1 
    User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/ libidn/1.23 librtmp/2.3 
    Accept: */*
  3. After sending the request, notice that the Axis2 server has logged the message and accepted the request.

How the implementation works


  1. .