---
schema_version: "1"
id: 7deae367d6b62701a030d9cd2376ce18a2d19b2e3fb6af3de4a3624b8d528014
title: 型付けされたエラーの表示
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/apikit/latest/apikit-4-display-fault-task.md
canonical_url: https://docs.mulesoft.com/jp/apikit/latest/apikit-4-display-fault-task
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 021746724f3801427c1f352c0b9d5c6282c7a23f02a10515d7c1f3869b1b930c
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
# 型付けされたエラーの表示

`ListInventory`​ 操作で型付けされたエラーを表示するようにします。tshirt2.wsdl ファイルには、WSDL 操作にマップされる ​**TshirtFault**​ 型のエラーが含まれています。

- `OrderTshirt`
- `ListInventory`
- `TrackOrder`

APIkit for SOAP は、次の種別の SOAP エラーをサポートしています。

- Soap Fault 1.1
- Soap Fault 1.2

型付けされたエラーが含まれないファイルでも、任意の WSDL ファイルを使用していずれかの種別を選択できます。

1. Anypoint Studio で、コマンドパレット内の ​**fault**​ を検索します。
    
    複数の ​`SOAP Fault`​ コンポーネントが表示される場合があります。
2. `SOAP Fault`​ を ​`ListInventory:api-config`​ フローにドラッグします。
    
    **「Operation Unavailable (操作は使用できません)」**​メッセージが表示された場合、操作をキャンセルして別の ​`SOAP Fault`​ コンポーネントを選択します。
3. バージョンの一致が見つかるまで、この手順を繰り返します。
4. プロパティエディターの ​**\[Module Configuration (モジュール設定)\]**​ で、​`soapkit-config`​ を選択します。
5. **\[Operation (操作)\]**​で、​`ListInventory`​ を選択します。
6. **\[Fault (エラー)\]**​ で、​`Fault`​ を選択します。
7. プロパティを保存します。
8. `Transform Message`​ コンポーネントを選択します。
9. DataWeave コードを次のように変更します。
    
    ```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. プロジェクトを保存して、もう一度実行します。
    
    SoapUI を使用して、​`ListInventory`​ 操作を実行します。
    
    クライアントは、デフォルトのエラーの代わりに次のエンベロープを返します。
    
    ```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>
    ```

## [](#関連情報)関連情報

- [SOAP ヘッダーの取得](https://docs.mulesoft.com/jp/apikit/latest/apikit-4-get-header-task)