1

ドキュメントでは、プロパティ CONTENT_TYPE は次のとおりです。

In situations where the ESB is receiving HTTP response messages without the Content-type header, this property can be used to specify a default content type to be used. If no such content type is specified for responses the ESB will default to 'application/octet-stream'.

Content-type のない HTTP テスト サービス応答メッセージがあるため、ESB 構成でプロパティ CONTENT_TYPE="text/plain" を設定します。応答は次のとおりです。

<axis2ns3:binary xmlns:axis2ns3="http://ws.apache.org/commons/ns/payload">UmV0dXJuQ29kZT0wMDAwMDANCg==</axis2ns3:binary>

resp.setContentType("text/plain")HTTP テスト サービスを追加すると、応答は次のようになります。

<text xmlns="http://ws.apache.org/commons/ns/payload">ReturnCode=000000</text>

上記のプロパティ CONTENT_TYPE 設定は役に立たないようです。デフォルトは「application/octet-stream」のままです。

Content-type ヘッダーのない HTTP サービスがあり、応答メッセージはバイナリです。レスポンス CONTENT_TYPE="text/plain" を設定するには? 誰でも私を助けることができますか?どうもありがとう。

4

1 に答える 1

0

次の行を axis2.xml ($ESB_HOME/repository/conf/axis2/axis2.xml) の messageFormatters に追加します。

<messageFormatter contentType="text/plain" class="org.apache.axis2.format.PlainTextFormatter"/>

次に、次のようにプロパティ メディエーターを使用して content-type を変更できます。

<property name="messageType" value="text/plain" scope="axis2"/>
于 2013-07-12T09:23:39.453 に答える