...
- Start the ESB profile and change the configuration as shown above.
- 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. - 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.
...
- Start the ESB profile and change the configuration as shown above.
- 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.
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 language html/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 language html/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:
- Start ActiveMQ and configure the JMS transport in WSO2 EI to work with ActiveMQ .
- Build and deploy the JAX-RS Basics /wiki/spaces/EI6xx/pages/49616411 sample.
- 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.
...