---
schema_version: "1"
id: 8ea974dc2975ffbc2bf95b059caa9f6f5b242524f9b9816ed303ac3a67a1dda1
title: Web Service Consumer の追加設定情報
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/web-service-consumer-connector/1.6/web-service-consumer-config-topics.md
canonical_url: https://docs.mulesoft.com/jp/web-service-consumer-connector/1.6/web-service-consumer-config-topics
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 6062213abc5a964db7528cf958c12a3d93fbd2e45481e3e1b8adb5b65808214b
description: MuleSoft Documentation Site
release: "1.6"
latest: false
---
# Web Service Consumer の追加設定情報

Anypoint Studio と XML エディターの両方でカスタム HTTP トランスポートや Web サービスセキュリティなど、Web サービスコンシューマー用 Anypoint Connector (Web Service Consumer Connector) の追加設定を定義します。

## [](#カスタム-http-トランスポートを設定する)カスタム HTTP トランスポートを設定する

デフォルトでは、コネクタは単純な保護されていない HTTP 設定を使用して、すべての送信 SOAP メッセージをディスパッチします。詳細な HTTP 設定が必要な場合、メッセージをディスパッチするために HTTP Connector 設定を使用して Web Service Consumer Connector をパラメーター化できます。

次の例では、コネクタで各要求がディスパッチされるように Web Service Consumer Connector 設定の ​**\[Transport Configuration (トランスポート設定)\]**​ パラメーターで HTTP 基本認証を使用して HTTP リクエスター設定を宣言して参照する方法を示しています。

1. Studio で Web Service Consumer Connector の ​**\[Global Element Properties (グローバル要素のプロパティ)\]**​ ウィンドウを開きます。
2. **\[Transport (トランスポート)\]**​ タブで、​**\[Transport Configuration (トランスポート設定)\]**​ に ​`HTTP Transport Configuration`​ を選択します。  
    **\[Requester Config (リクエスター設定)\]**​ 項目には自動的に ​`HTTP_Request_configuration`​ が入力されます。
3. **\[OK\]**​ をクリックします。

Studio での HTTP トランスポートの設定は次のようになります。

![カスタム HTTP トランスポートを設定する](/mulesoft/current/ja-jp/web-service-consumer-connector/1.6/_images/web-service-consumer-configure-transport.png)

Figure 1. カスタム HTTP トランスポートを設定する

**\[Configuration XML (設定 XML)\]**​ タブで、HTTP リクエスター設定 ​`<http:request-config name="basic-auth">`​ の参照は Web サービスコンシューマー設定 ​`<wsc:custom-transport-configuration>`​ の下にあります。

```xml
<http:request-config name="basic-auth">
    <http:request-connection host="www.exampleplace.com" port="8182" protocol="HTTP">
        <http:authentication>
            <http:basic-authentication username="admin" password="textpassword"/>
        </http:authentication>
    </http:request-connection>
</http:request-config>

<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="http://www.host.com?WSDL" service="Service" port="Port">
        <wsc:custom-transport-configuration>
            <wsc:http-transport-configuration requesterConfig="basic-auth"/>
        </wsc:custom-transport-configuration>
    </wsc:connection>
</wsc:config>
```

## [](#web-サービスセキュリティの設定)Web サービスセキュリティの設定

WS-Security プロトコルにより、さまざまなセキュリティトークン形式を使用してメッセージの整合性および機密性を適用できます。このプロトコルでは、エンドツーエンドセキュリティを提供するために XML 署名と XML 暗号化を使用します。

WS-Security は、次の方法を記述します。

- 整合性を確保して非否認を提供するために SOAP メッセージに署名する。
- 機密性を確保するために SOAP メッセージを暗号化する。
- 送信者の ID を確認するためにセキュリティトークンを添付する。

Web Service Consumer Connector は、次のメカニズムをサポートします。

- Timestamp (タイムスタンプ)
- 署名または署名検証
- Username (ユーザー名)
- 暗号化または復号化

次の例では、コネクタの Web サービスセキュリティのユーザー名トークンセキュリティ戦略を設定する方法を示しています。

1. Studio で Web Service Consumer Connector の ​**\[Global Element Properties (グローバル要素のプロパティ)\]**​ ウィンドウを開きます。
2. **\[Security (セキュリティ)\]**​ タブで、​**\[Username token security strategy (ユーザー名トークンセキュリティ戦略)\]**​ に ​`Edit inline`​ を選択します。
3. **\[Username (ユーザー名)\]**​ 項目と ​**\[Password (パスワード)\]**​ 項目に入力し、​**\[Add nonce (ノンスを追加)\]**​ 項目と ​**\[Add created (作成済みを追加)\]**​ 項目を ​`true`​ に設定します。
4. **\[OK\]**​ をクリックします。

Studio での Web サービスセキュリティの設定は次のようになります。

![Web サービスセキュリティの設定](/mulesoft/current/ja-jp/web-service-consumer-connector/1.6/_images/web-service-consumer-configure-wsecurity.png)

Figure 2. Web サービスセキュリティの設定

**\[Configuration XML (設定 XML)\]**​ タブでは、Web サービスセキュリティの設定は次のように記述されます。

```xml
<wsc:config name="with-custom-transport">
    <wsc:connection wsdlLocation="http://www.host.com?WSDL" service="Service" port="Port">
        <wsc:web-service-security>
            <wsc:username-token-security-strategy username="admin" password="textPassword" addCreated="true" addNonce="true"/>
        </wsc:web-service-security>
    </wsc:connection>
</wsc:config>
```

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

- [MuleSoft ヘルプセンター](https://help.mulesoft.com)
- [Web Service Consumer Connector リファレンス](https://docs.mulesoft.com/jp/web-service-consumer-connector/1.6/web-service-consumer-reference)