1

を介してインバウンド要求を取得する SOAP サービス フローがあります<cxf:proxy-service>。ペイロードを文字列として取得するために、その直後にJavaコンポーネントがあります。

これが私のフローです:

<flow name="soapService">
    <http:inbound-endpoint address="${service.address}" exchange-pattern="request-response">
        <cxf:proxy-service wsdlLocation="classpath:service.wsdl" namespace="http://pennmutual.com/services/mvi" service="MVIService" enableMuleSoapHeaders="false"/>                
    </http:inbound-endpoint>        
    <component class="test.GetPayload" />
  .
  .
  .
 </flow>

そして、ここに私の GetPayload クラスがあります:

public Object onCall(MuleEventContext eventContext) throws Exception {
    String requestXml = null;
    try {

        requestXml = eventContext.getMessage().getPayloadAsString();
        logger.debug("Request XML " + requestXml);

    } catch (Exception e) {
        e.printStackTrace();
    }
    return requestXml;
}

GetPayload クラスを取り除き、同じことを自分の で行う方法が必要ですmule-config。私は試した <object-to-string-transformer/>

<set-payload value="#[message.payloadAsString]"/>

しかしmessage.payloadAsString、例外をスローします。理由がわかりません。

4

1 に答える 1