2013-05-17 5 views
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> 

가 감사 내 흐름입니다.

답변

1

이 표현식 #[payload.contains('c22')]은 페이로드가 InputStream이므로 작동하지 않습니다. 뮬 로그에 스택 트레이스가 보이지 않습니까?

어쨌든 choice 앞에 <object-to-string-transformer />을 추가하고 문제가 해결되는지 확인하십시오.

편집 :

문제는 당신이 XML로 CXF 응답 객체 (org.apache.cxf.staxutils.DepthXMLStreamReader)를 직렬화 (xm:object-to-xml-transformer에서) XStream과를 사용하고 있다는 점이다. CXF 응답에는 흐름의 응답 단계에서 cxf:proxy-client이 처리해야합니다. choice 라우터 뒤의 xm:object-to-xml-transformerfile:outbound-endpoint은이 메커니즘을 방해 할 가능성이 있습니다. 응답 단계에서 실행하기 전에 choice 라우터 위의 response 요소로 래핑 해보십시오.

다른 질문이 있으시면 https://stackoverflow.com/a/16615537/387927에 이미이 조언을 제공해 주셨지만 응답하지 않았습니다. http:outbound-endpoint의 후 메시지 페이로드는 org.apache.cxf.staxutils.DepthXMLStreamReader 일 화재로이 변압기를 방지해야합니다

또한 나는 byte-array-to-string-transformer 아무것도하지 생각하지 않습니다.

+0

선택 사항을 테스트 한 결과 이제는 정상적으로 작동합니다. 제 질문에 대한 흐름도 업데이트했습니다. 다른 출력물이 있습니다. 제발 도와 주실 수 있습니까? 고맙습니다. –

+0

문제의 일부가 해결되면 기존 질문을 수정하는 것은 바람직하지 않습니다. 답변에 대한 답변을 확대하겠습니다.하지만 앞으로는 새로운 질문을 열어주십시오. –

+0

오케이, 미안하지만, 지금 알고 있습니다. 감사합니다. –