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
Objective: Introduction to inline script mediation
- Start the Axis2 server and deploy the
SimpleStockQuoteService if not already done.
<!-- transform the custom quote request into a standard quote request expected by the service -->
var symbol = mc.getPayloadXML()..*::Code.toString();
<!-- transform the standard response back into the custom format the client expects -->
var symbol = mc.getPayloadXML()..*::symbol.toString();
var price = mc.getPayloadXML()..*::last.toString();
The functionality of this sample is similar to that of sample 350 and sample 8. It demonstrates how to use inline scripts in the mediation within the ESB. Use the stock quote client to issue a custom quote client as follows.
ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/ -Dmode=customquote