0

Mule の HTTP エンドポイントにカスタム ヘッダーを追加しようとしています。

<flow name="flow">
    <poll frequency="60000">
        <http:outbound-endpoint
            address="http://user:pass@example.com"
            followRedirects="true" method="GET" exchange-pattern="request-response">
            <properties>
                <spring:entry key="CUSTOM-HEADER-NAME" value="custom-header-value" />
            </properties>
        </http:outbound-endpoint>
    </poll>
    <echo-component />
</flow>

しかし、カスタム ヘッダーを追加するために要素を使用するこの方法は<spring:entry>機能していないようです。

交換してみました

<properties>
    <spring:entry key="CUSTOM-HEADER-NAME" value="custom-header-value" />
</properties>

<property key="CUSTOM-HEADER-NAME" value="custom-header-value"/>

しかし、それもうまくいきません。エラーは表示されませんが、取得している応答は、カスタム ヘッダーなしで取得するものです。

カスタムヘッダーを追加する正しい方法に従っていますか? Mule 3.2.0 を使用しています。

4

2 に答える 2

1

を使用して動作しました<message-properties-transformer>

<http:outbound-endpoint
    address="http://user:pass@example.com"
    followRedirects="true" method="GET" exchange-pattern="request-response">
    <message-properties-transformer
        scope="outbound">
        <add-message-property key="CUSTOM-HEADER-NAME"
            value="custom-header-value" />
        </message-properties-transformer>
</http:outbound-endpoint>
于 2014-04-10T11:02:20.723 に答える