Versions Compared

Key

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

...

  1. Start the ESB profile and change the configuration as shown above.
  2. Deploy the back-end service 'SimpleStockQuoteService' and start the Axis2 server using the instructions in Starting Sample Back-End Services /wiki/spaces/EI6xx/pages/49610865.
    You will now send a message to the back-end service through the ESB profile using the sample Stock Quote Client /wiki/spaces/EI6xx/pages/49611458. This client can run in several modes.
  3. Run the following ant command from the <EI_HOME>/samples/axis2Client directory to trigger a sample message to the back-end service:
    ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Drest=true

...

In this scenario, the client sends a SOAP message to the ESB profile, which transforms it to a REST message and sends it to the back-end service. Once the back-end response is received, the ESB profile sends it back to the client as a SOAP message. The filter mediator is used to identify the required service. Though this example only has one filter, there could be many filters in the real scenario. The REST_URL_POSTFIX property is a well-defined property, and its value is appended to the target URL when sending messages out in a RESTful manner. Similar to REST_URL_POSTFIX, the HTTP_METHOD property is also well-defined and sets the HTTP verb to GET.

...

  1. Start the ESB profile and change the configuration as shown above.
  2. Build and deploy the JAX-RS Basics /wiki/spaces/EI6xx/pages/49616411 sample. This sample is shipped with WSO2 EI. It contains a set of pure RESTful services, so we will use this as our back-end service.
  3. Send a message to the back-end service through the ESB profile using SoapUI. The service used in this scenario is the getCustomer service, which requires the customer ID to complete its task. A sample SOAP message that is used to achieve this is as follows:

    Code Block
    languagehtml/xml
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header/> 
       <soapenv:Body>
         <getCustomer>
            <id>123</id>
         </getCustomer>
       </soapenv:Body>
    </soapenv:Envelope>

    This message simply represents the relevant method to be invoked and its associated value. Upon successful execution, SoapUI should display the following message in response.

    Code Block
    languagehtml/xml
    <Customer>
       <id>123</id>
       <name>John</name>
    </Customer>

...

In this scenario, a proxy service in the ESB profile listens to a JMS queue, picks up available messages from that queue, and delivers the messages to the REST back-end service. For the JMS front-end client, we will use the sample JMSClient /wiki/spaces/EI6xx/pages/49611458 that ships with the ESB profile. For the REST back-end service, we will use the JAX-RS Basics /wiki/spaces/EI6xx/pages/49616411 sample service that is shipped with the ESB profile. We will use ActiveMQ as the message broker.

...

To implement this scenario:

  1. Start ActiveMQ and configure the JMS transport in WSO2 EI to work with ActiveMQ .
  2. Build and deploy the JAX-RS Basics /wiki/spaces/EI6xx/pages/49616411 sample.
  3. Goto <EI_HOME>/samples/axis2Client and execute the following command:
    ant jmsclient -Djms_type=text -Djms_dest=dynamicQueues/JmsToRestProxy -Djms_payload="<Customer><name>WSO2</name></Customer>"
    This sends <Customer><name>WSO2</name></Customer> as the payload.

...