---
schema_version: "1"
id: 154c7418c8b67d31e6bb1366adaa8edaf9112960d5b9b0bbb3ecc272fba70a76
title: Display a Typed SOAP Fault
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/apikit/latest/apikit-4-display-fault-task.md
canonical_url: https://docs.mulesoft.com/apikit/latest/apikit-4-display-fault-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9743aaf7de38f417e11d06fae1da20a8c17f9783b50281bb6ad0e68558c5d6f5
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
---
product: APIkit
version: 4.x
is-latest-version: true
---

# Display a Typed SOAP Fault

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Configure the `ListInventory` operation in APIkit for SOAP so responses surface the **TshirtFault**
typed fault from `tshirt2.wsdl`, which also maps faults to `OrderTshirt`, `ListInventory`, and
`TrackOrder`. Select Soap Fault 1.1 or Soap Fault 1.2 for any WSDL, including services that do not
declare typed faults.

1.  In Anypoint Studio, search for **fault** in the command palette.

    Multiple `SOAP Fault` components can appear.

2.  Drag `SOAP Fault` to the `ListInventory:api-config` flow.

    If **Operation Unavailable** message appears, cancel the operation and select another
    `SOAP Fault` component.

3.  Repeat these steps until you find a version match.

4.  In the properties editor, in **Module Configuration**, select `soapkit-config`.

5.  In **Operation**, select `ListInventory`.

6.  In **Fault**, select `Fault`.

7.  Save the properties.

8.  Select the `Transform Message` component.

9.  Modify the DataWeave code as follows:

    ```raml
    %dw 2.0
    output application/xml
    ns ns0 http://mulesoft.org/tshirt-service
    ns soap http://schemas.xmlsoap.org/soap/envelope/
    ---
    {
      soap#Fault: {
        faultcode: "soap:Server",
        faultstring: "The error details",
        detail: {
          ns0#TshirtFault: {
            errorStuff: 500
          }
        }
      }
    }
    ```

10. Save the project and run it again.

    Using SoapUI, run the `ListInventory` operation.

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

    ```xml
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <soap:Fault>
             <faultcode>soap:Server</faultcode>
             <faultstring>The error details</faultstring>
             <detail>
                <ns0:TshirtFault xmlns:ns0="http://mulesoft.org/tshirt-service">
                   <errorStuff>500</errorStuff>
                </ns0:TshirtFault>
             </detail>
          </soap:Fault>
       </soap:Body>
    </soap:Envelope>
    ```

## See Also

- [Get a SOAP Header](https://docs.mulesoft.com/apikit/latest/apikit-4-get-header-task)
