2012-02-17 2 views
6

여러 웹 서비스에 요청을 보내고받은 응답의 목록을 집계하는 뮬 애플리케이션이 있습니다. 목록을 반환하는 방법은 목록의 첫 번째 응답을 가져 오는 것입니다. 목록이 처리됩니다 CustomJavaClass : 그 볼 생각처럼이 브라우저를 통해 그것에 도달하려고하면 내가 WSDL에 도달 할 수 있어요ESB : 스트림 페이로드가 포함 된 메시지를 복사 할 수 없습니다.

return responses.get(0); 

는 반환 된 WSDL 보인다.

Exception stack is: 
1. Cannot copy message with a stream payload. Payload type is "org.apache.commons.httpclient.ContentLengthInputStream". Message payload is of type: ContentLengthInputStream (org.mule.api.MessagingException) 
    org.mule.routing.outbound.AbstractSequenceRouter:73 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) 
-------------------------------------------------------------------------------- 
Root Exception stack trace: 
org.mule.api.MessagingException: Cannot copy message with a stream payload. Payload type is "org.apache.commons.httpclient.ContentLengthInputStream". Message payload is of type: ContentLengthInputStream 
    at org.mule.routing.outbound.AbstractSequenceRouter.route(AbstractSequenceRouter.java:73) 
    at org.mule.routing.outbound.AbstractOutboundRouter$1.doInTransaction(AbstractOutboundRouter.java:102) 
    at org.mule.routing.outbound.AbstractOutboundRouter$1.doInTransaction(AbstractOutboundRouter.java:99) 
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) 

SOAPUi 예외 :

Failed to route event via endpoint: org.mule.api.p[email protected]ceb6dd. Message payload is of type: ContentLengthInputStream 

내 현재의 구성 :

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation=" 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd 
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd 
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd "> 
    <flow name="flows1Flow1" doc:name="flows1Flow1"> 
     <http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:4433/miniwebservice" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/> 
     <logger level="INFO" category="ddo" doc:name="Logger"/> 
     <all doc:name="All"> 
      <processor-chain> 
       <message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties"> 
        <add-message-property key="http.method" value="#[header:INBOUND:http.method]"/> 
       </message-properties-transformer> 
       <http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4435/miniwebservice#[header:INBOUND:http.request]" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/> 
       <mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace.xsl" doc:name="XSLT"/> 
      </processor-chain> 
      <processor-chain> 
       <message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties"> 
        <add-message-property key="http.method" value="#[header:INBOUND:http.method]"/> 
       </message-properties-transformer> 
       <http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4434/miniwebservice#[header:INBOUND:http.request]" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/> 
       <mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace2.xsl" doc:name="XSLT"/> 
      </processor-chain> 
     </all> 
     <mulexml:xml-to-object-transformer doc:name="XML to Object"/> 
     <component class="CustomJavaClass" doc:name="Java"/> 
     <byte-array-to-string-transformer ignoreBadInput="true" encoding="UTF-8" mimeType="text/xml" doc:name="Byte Array to String"/> 
    </flow> 
</mule> 

답변

8

점점 WSDL이 때문에 작동하지만 난 나는 내가 다음과 같은 예외가 SoapUi를 통해 메시지를 보내려고 GET 요청은 페이로드를 전달하지 않습니다. 그러나 SOAP 메소드를 호출하려고하면 POST 페이로드는 물론 여러 번 디스패치 될 수없는 InputStream입니다.

따라서하십시오으로 HTTP 입력 스트림을 직렬화 : 인바운드 엔드 포인트 :

<object-to-byte-array-transformer /> 

바로 HTTP 후.

관련 문제