0

Jboss 7 で実行されているビジネス サービスに MtoM 対応を追加した後、Mule を介して SOAP リクエストを渡すとエラーが発生することがわかりました。

<faultstring>An exception occurred while invoking message processor "DefaultMessageProcessorChain '(inner iterating chain) of OutboundEndpoint 'http://127.0.0.1:8280/communication' request chain' 
[ 
  org.mule.endpoint.outbound.OutboundEventTimeoutMessageProcessor, 
  org.mule.endpoint.outbound.OutboundSessionHandlerMessageProcessor, 
  org.mule.endpoint.outbound.OutboundEndpointPropertyMessageProcessor, 
  org.mule.endpoint.outbound.OutboundResponsePropertiesMessageProcessor
]" with transaction "Transaction{factory=null, action=NEVER, timeout=0}".. Message payload is of type: PostMethod</faultstring>

これは、サービス応答からのペイロードが SOAPUI に戻される前に検証されるときに発生する検証エラーが原因であると思われます。Mule ログ ファイルを確認すると、次のように記録されています。

Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:222)
    at ... 80 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
 at [row,col {unknown-source}]: [1,1]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:644)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2003)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1100)
    at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1123)
    at org.mule.module.xml.stax.DelegateXMLStreamReader.nextTag(DelegateXMLStreamReader.java:242)
    at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:122)
    ... 90 more

このエラーは、実際には SOAP エンベロープのヘッダーに次のテキストが含まれているのに、MULE が validatingStreamReader で SOAP 応答を XML として解析しようとするために発生したようです。

[------=_Part_22_1884954755.1363694621407 Content-Type:application/xop+xml;charset=utf-8;type="text/xml"

<SOAP-ENV:Envelope.....

したがって、MtoM マークアップによって SOAP パケットが不正な形式になっているため、検証が失敗しています。

以下は私のミュール設定です

<!-- Primary Choice router is used to forward requests to the wsdl proxy 
        and SOAPflow this should be the only endpoint that is exposed to the public 
        domain. -->
    <flow name="SOAInboundRouter">
        <!-- public inbound listener -->
        <inbound-endpoint address="${web.inboundAddress}"
            exchange-pattern="request-response" />

        <!-- Outbound filter for routing requests -->
        <choice>
            <when>
                <regex-filter pattern="soap" />
                <outbound-endpoint
                    address="${soa.inboundAddress}#[header:inbound:http.request]"
                    exchange-pattern="request-response" />
            </when>
        </choice>

    </flow>

    <!-- Flow used for SOAP request processing, this implements a callback to 
        check the SOAP header for the correct username token for WS-Security request 
        are passed to this flow by the Flow SOAInboundRouter. This endpoint is not 
        for use in the public domain. -->

    <flow name="SoapFlow">
        <!-- http listener for SOAP requests -->
        <inbound-endpoint address="${soa.inboundAddress}"
            exchange-pattern="request-response">
            <cxf:proxy-service service="" namespace="">
                <!-- WS-Security intercetor applied to the inbound request -->
                <cxf:inInterceptors>
                    <spring:ref bean="cxfSecurityInterceptor" />
                </cxf:inInterceptors>

            </cxf:proxy-service>
        </inbound-endpoint>

        <!--Success on authentication request is passed to outbound router this 
            is the actual service -->
        <outbound-endpoint
            address="${soa.outboundAddress}#[header:inbound:http.request]"
            exchange-pattern="request-response">
            <cxf:proxy-client />
        </outbound-endpoint>

    </flow>

    <!-- application configuration -->
    <spring:bean id="cxfSecurityInterceptor"
        class="uk.co.weatherbys.security.esb.cxf.CXFSecurityInterceptor"
        scope="prototype">
        <spring:constructor-arg value="${mule.userfile}" />
        <spring:property name="wServiceHeaderDelegate" ref="wServiceHeaderDelegate" />
        <spring:property name="cxfWsSecurityDelegate" ref="cXfWsSecurityDelegate" />
    </spring:bean>

    <spring:bean id="wServiceHeaderDelegate"
        class="uk.co.weatherbys.security.esb.cxf.WServiceHeaderDelegate">
    </spring:bean>

    <spring:bean id="cXfWsSecurityDelegate"
        class="uk.co.weatherbys.security.esb.cxf.CxfWsSecurityDelegate">
    </spring:bean>

どこでも解決策を確認しましたが、解決策が見つかりません。誰か提案はありますか?どうにかしてアウトバウンド検証をオフにすることはできますか? この非標準のヘッダー情報を処理するには、トランスフォーマーを構成する必要がありますか? 新しいフローが必要ですか?

ありがとう

4

1 に答える 1

1

CXFプロキシがコンテンツタイプをマルチパート/関連から変更する前に、似たようなものを見たことがあります。type = "application / xop + xml"; .....応答の「text/plain」に。

Content-Typeをログに記録し、次のようにContent-Typeを手動で設定またはコピーしてみることができます。

<code>
    <message-properties-transformer>
    <add-message-property key="Content-Type" value="#[header:Content-Type]" />
    </message-properties-transformer> 
</code>

http://forums.mulesoft.org/message.jspa?messageID=9152を参照して、下にスクロールするか、「wstx」を検索してください。

于 2013-03-19T16:56:15.827 に答える