Objective: Introduce ESB Mediation Libraries and how to invoke the templates.
Deploy SampleConnectorLib library to WSO2 ESB.
- Import SampleConnectorLib.
- Start the Axis2 server and deploy the
SimpleStockQuoteServiceif not already done.
In this example "SampleLibProxy" is created to invoke templates defined in the "SampleConnectorLib" library. Target name is a combination of the package name of the library and the target operation name. Package name of "SampleConnectorLib" is "org.apache.synapse.sample" and the operation defined inside is "stockquote".
Following is the template of the "stockquote" operation.
To invoke the "SampleLibProxy" execute the stock quote client by requesting for a stock quote on the proxy service as follows:
When the stockquote request is sent to the SampleLibProxy, it calls the stockquote template and then the request is forwarded to the sample service hosted on Axis2. The response from the SimpleStockQuoteService is sent back to the client.