0

当我运行我的流程时,我收到以下错误`

<org.apache.cxf.staxutils.DepthXMLStreamReader>
  <reader class="org.mule.module.cxf.support.StreamClosingInterceptor$1">
    <reader class="com.ctc.wstx.sr.ValidatingStreamReader">
      <mXml11>false</mXml11>
      <mInputBuffer>xmlns:ns2=&quot;http://wsdouane/&quot;&gt;&lt;return&gt;&lt;douanePK&gt;&lt;idConteneurId&gt;ctr1&lt;/idConteneurId&gt;&lt;idCritereId&gt;C11&lt;/idCritereId&gt;&lt;/douanePK&gt;&lt;valeurId&gt;oui&lt;/valeurId&gt;&lt;/return&gt;&lt;/ns2:findResponse&gt;&lt;/S:Body&gt;&lt;/S:Envelope&gt;&#x0;&#x0;.................

我们可以从 开始看到正确的肥皂响应<mInputBuffer>,有没有办法只获得肥皂响应?

这是我的流程

 <flow name="SOAPWebService" doc:name="SOAPWebService">
    <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:8088/esb" doc:name="HTTP"/>
    <object-to-string-transformer doc:name="Object to String"/>
    <choice doc:name="Choice">
        <when expression="#[payload.contains('C22')]">
            <set-variable variableName="paramCtr" value="#[message.inboundProperties['ctr']]" doc:name="conteneur"/>
            <set-variable variableName="paramC" value="#[message.inboundProperties['c']]" doc:name="critere"/>
            <component class="com.example.components.SampleComponent" doc:name="Java"/>
            <mulexml:xslt-transformer  maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\MuleStudio\SandBox\resources\PrepareRequestXMLPort.xsl" doc:name="XSLT">
                <mulexml:context-property key="paramCtr" value="#[flowVars['paramCtr']]" />
                <mulexml:context-property key="paramC"  value="#[flowVars['paramC']]" />
            </mulexml:xslt-transformer>
            <cxf:proxy-client payload="body" enableMuleSoapHeaders="true" doc:name="SOAP"/>
            <http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:8080/ClientsDB/port" doc:name="PortWS"/>
            <byte-array-to-string-transformer   doc:name="Byte Array to String" />
        </when>
        <otherwise>
            <set-variable variableName="paramCtr" value="#[message.inboundProperties['ctr']]" doc:name="conteneur"/>
            <set-variable variableName="paramC" value="#[message.inboundProperties['c']]" doc:name="critere"/>
            <component class="com.example.components.SampleComponent" doc:name="Java"/>
            <mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\MuleStudio\SandBox\resources\PrepareRequestXMLDouane.xsl" doc:name="XSLT">
                <mulexml:context-property key="paramCtr"  value="#[flowVars['paramCtr']]" />
                <mulexml:context-property key="paramC"  value="#[flowVars['paramC']]" />
            </mulexml:xslt-transformer>                
            <cxf:proxy-client payload="body" enableMuleSoapHeaders="true" doc:name="SOAP"/>
            <http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:8080/ClientsDB/douane" doc:name="DouaneWS"/>
            <byte-array-to-string-transformer doc:name="Byte Array to String"/>
        </otherwise>
    </choice>
    <xm:object-to-xml-transformer doc:name="Object to XML"/>
    <file:outbound-endpoint path="C:\MuleStudio\SandBox\output" outputPattern="#[function:datestamp:dd-MM-yy]_#[function:systime].xml " responseTimeout="10000" doc:name="Outgoing File"/>
</flow>

谢谢你。

4

1 回答 1

1

此表达式#[payload.contains('c22')]无法工作,因为有效负载是InputStream. 您没有在 Mule 的日志中看到堆栈跟踪吗?

无论如何,请尝试<object-to-string-transformer />在 the 之前添加choice,看看它是否可以解决问题。

编辑:

问题是您使用 XStream (in xm:object-to-xml-transformer) 将 CXF 响应对象 ( org.apache.cxf.staxutils.DepthXMLStreamReader) 序列化为 XML。CXF 响应不应该被弄乱,应该由cxf:proxy-client流的响应阶段处理。xm:object-to-xml-transformer路由器和file:outbound-endpoint之后的路由器choice可能会干扰这种机制。尝试将它们包装在路由器response上方的元素中,choice以便它们在响应阶段之后执行。

请注意,我已经在您的其他问题https://stackoverflow.com/a/16615537/387927中向您提供了此建议,但您没有对此做出反应。

另外我不认为byte-array-to-string-transformer做任何事情: s 之后的消息有效负载http:outbound-endpoint应该是org.apache.cxf.staxutils.DepthXMLStreamReader,防止这个转换器触发。

于 2013-05-17T18:12:03.347 回答