Contact Us 1-800-596-4880

To Display a Typed Fault

In this procedure, you make the ListInventory operation display the typed fault. For the tshirt2.wsdl file, there is just one typed fault named TshirtFault, which is mapped to every operation that the WSDL has: OrderTshirt, ListInventory, and TrackOrder.

APIkit for SOAP supports the following types of SOAP faults:

  • Soap Fault 1.1

  • Soap Fault 1.2

You can select either type using any WSDL file, even for those files that do not contain typed faults.

  1. In Studio, delete the Set Payload processor of the ListInventory:api-config flow.

  2. Search for fault in the palette, drag and drop SOAP Fault into the ListInventory:api-config flow.

  3. In the properties editor, select ListInventory from the Operation drop-down.

  4. Select or accept the default TshirtFault from the Fault Type drop-down.

  5. Add a Transform Message component before the SOAP Fault component.

  6. In the component properties, set up the following DataWeave code:

    %dw 1.0
     %output application/xml
     %namespace ns0
     %namespace soap
     soap#Fault: {
       faultcode: "soap:Server",
       faultstring: "The error details",
       detail: {
         ns0#TshirtFault: {
          errorStuff: 500
  7. Save and rerun the project.

    Using the SoapUI client, run the ListInventory operation.

    The client returns the following envelope instead of the default fault:

    <soap:Envelope xmlns:soap="">
          <soap:Fault xmlns:soap="">
             <faultstring>The error details</faultstring>
                <ns0:TshirtFault xmlns:ns0="">