This sample demonstrates the functionality ofIt sends a message from a sample client to a back-end service through the ESB and uses the XSLT Mediator to perform transformations. The XSLT transformations are specified as registry resources.
Building the Sample
1. Start the ESB with sample 8 configuration using the instructions given in Starting Sample ESB Configurations.
2. A message should appear in the command or text Linux console stating the server started successfully.
<definitions xmlns="http://ws.apache.org/ns/synapse"> <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) --> <registry provider="org.wso2.carbon.mediation.registry.ESBRegistry"> <!-- the root property of the simple URL registry helps resolve a resource URL as root + key --> <parameter name="root">file:./repository/samples/resources/</parameter> <!-- all resources loaded from the URL registry would be cached for this number of milli seconds --> <parameter name="cachableDuration">15000</parameter> </registry> <!-- define the request processing XSLT resource as a static URL source --> <localEntry key="xslt-key-req" src="file:repository/samples/resources/transform/transform.xslt"/> <sequence name="main"> <in> <!-- transform the custom quote request into a standard quote requst expected by the service --> <xslt key="xslt-key-req"/> <send/> </in> <out> <!-- transform the standard response back into the custom format the client expects --> <!-- the key is looked up in the remote registry and loaded as a 'dynamic' registry resource --> <xslt key="transform/transform_back.xslt"/> <send/> </out> <send</>sequence> </definitions>
4. Deploy the back-end service 'SimpleStockQuoteService' and start the Axis2 server using the instructions given in section Starting Sample Back-End Services.
5. Now you have a running ESB instance and a back-end service deployed. In the next section, we will send a message to the back-end service through the ESB using a sample client.
1. The sample client used here is 'Stock Quote Client' which can operate in several modes. For instructions on this sample client and its operation modes, refer to Stock Quote Client. Run the following ant command from
<ESB_HOME>/samples/axis2Client directory and analyze the the ESB debug log output on the ESB console.