This configuration file
synapse_sample_380.xml is available in the
<ESB<EI_HOME>/repositorysamples/samples service-bus directory.
To build the sample
Run the following command from the
Code Block language bash
ant stockquote -Dsymbol=IBM -Dmode=quote -Daddurl=http://localhost:8280
When the client is run, you will see see see the following discounted quote value on the client console.
All classes developed for class mediation should implement the Mediator interface, which contains the mediate(...) method. mediate(...) method of the above class is invoked for each response message mediated through the main sequence, with the message context of the current message as the parameter. All the details of the message including the SOAP headers, SOAP body and properties of the context hierarchy can be accessed from the message context. In this sample, the body of the message is retrieved and the discount percentage is subtracted from the quote price. If the quote request number is less than the number specified in the "bonusFor" property in the configuration, a special discount is given.