Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation:
repository/samples/directory that includes all Integration profile samples is changed to
repository/samples/resources/directory that includes all artifacts related to the Integration profile samples is changed to
Follow the steps below before starting these sample configurations.
- Start WSO2 EI with the sample 908 configuration. For instructions on starting a sample configuration, see Starting 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."
- Start the Axis2 server. For instructions on starting the Axis2 server, see Starting the Axis2 server.
Deploy the back-end service SimpleStockQuoteService. For instructions on deploying sample back-end services, see Deploying sample back-end services.
Now you have a running WSO2 EI instance and a back-end service deployed.
Building the Sample
The XML configuration for this sample, which is available in the
<EI_HOME>/samples/service-bus/synapse_sample_908.xml file is as follows:
The content of
<EI_HOME>/samples/service-bus/resources/script/stockquoteTransformNashorn.js, which is referred from the above
synapse_sample_908.xml file is as follows:
Navigate to the
<EI_HOME>/samples/service-bus/synapse_sample_908.xml file and execute the
ant command to build this sample.
Executing the Sample
Navigate to the
<EI_HOME>/samples/axis2Client directory and execute the following command to use the stock quote client to issue a custom quote as follows.
For further details on this sample client and its operation modes, see Stock Quote Client.
Analyzing the output
stockquoteTransformNashorn.js script used this sample has two functions,
transformResponse(). The Synapse configuration defined in the
synapse_sample_908.xml file uses the function attribute to specify which function should be invoked.