title: Mule ESB : Cannot copy message with a stream payload
body: <p>I have a Mule Application where I send a Request to Multiple WebServices and aggregate the List of responses i get , the idea is to get the first response of the List by returning it from the CustomJavaClass where the list is handled :</p>
  
  <pre><code>return responses.get(0);
  </code></pre>
  
  <p>I am able to reach the WSDL if I try to reach it over a Browser , the returned WSDL looks like its supposed to look . But i I try to send a message via SoapUi i get the following exception :</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>SOAPUi Exception :</p>
  
  <pre><code>Failed to route event via endpoint: org.mule.api.processor.MessageProcessors$LifecyleAwareMessageProcessorWrapper@ceb6dd. Message payload is of type: ContentLengthInputStream
  </code></pre>
  
  <p>my current configurations : </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;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 "&gt;
      &lt;flow name="flows1Flow1" doc:name="flows1Flow1"&gt;
          &lt;http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:4433/miniwebservice" encoding="UTF-8" mimeType="text/xml" doc:name="HTTP"/&gt;
          &lt;logger level="INFO" category="ddo" doc:name="Logger"/&gt;
          &lt;all doc:name="All"&gt;
              &lt;processor-chain&gt;
                  &lt;message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties"&gt;
                      &lt;add-message-property key="http.method" value="#[header:INBOUND:http.method]"/&gt;
                  &lt;/message-properties-transformer&gt;
                  &lt;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"/&gt;
                  &lt;mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace.xsl" doc:name="XSLT"/&gt;
              &lt;/processor-chain&gt;
              &lt;processor-chain&gt;
                  &lt;message-properties-transformer encoding="UTF-8" mimeType="text/xml" doc:name="Message Properties"&gt;
                      &lt;add-message-property key="http.method" value="#[header:INBOUND:http.method]"/&gt;
                  &lt;/message-properties-transformer&gt;
                  &lt;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"/&gt;
                  &lt;mulexml:xslt-transformer mimeType="text/xml" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace2.xsl" doc:name="XSLT"/&gt;
              &lt;/processor-chain&gt;
          &lt;/all&gt;
          &lt;mulexml:xml-to-object-transformer doc:name="XML to Object"/&gt;
          &lt;component class="CustomJavaClass" doc:name="Java"/&gt;
          &lt;byte-array-to-string-transformer ignoreBadInput="true" encoding="UTF-8" mimeType="text/xml" doc:name="Byte Array to String"/&gt;
      &lt;/flow&gt;
  &lt;/mule&gt;
  </code></pre>