This documentation is for WSO2 Enterprise Service Bus version 4.7.0 . View documentation for the latest release.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This sample demonstrates the functionality of 'makefault' mediator.  It sends a message from a sample client to a back-end service through the ESB through 2 faulty mediation options and sends back appropriate SOAP error responses to the client.

Prerequisites

See Installation PrerequisitesFor a list of prerequisites, see the Prerequisites section in ESB Samples Setup.

Building the Sample

1. Start the ESB with sample 5 configuration using the instructions given in Starting Sample ESB Configurations.

...

Code Block
languagehtml/xml
<soapenv:FaultEnvelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<faultcode>soapenv:Client</faultcode>
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode xmlns:tns="http://www.w3.org/2003/05/soap-envelope">tns:Receiver</faultcode>
        <faultstring>Connection   refused or<faultstring>Error failedconnecting forto :the bogus:9000back <end</faultstring>
	<detail />
        </soapenv:Fault>
    </soapenv:Fault>Body>
</soapenv:Envelope>

4. Run the following ant command to trigger a SUN stock quote request to the back-end service.

...

Code Block
languagehtml/xml
<soapenv:FaultEnvelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<faultcode>soapenv:Client</faultcode>
    <soapenv:Body>
        <soapenv:Fault>
       <faultstring> Connection refused or failed for : localhost/127.0.0.1:9009</faultstring>
	<detail /><faultcode xmlns:tns="http://www.w3.org/2003/05/soap-envelope">tns:Receiver</faultcode>
            <faultstring>Error connecting to the back end</faultstring>
        </soapenv:Fault>
    </soapenv:Fault>Body>
</soapenv:Envelope>
Excerpt
hiddentrue

Example of message mediation in WSO2 ESB.