title: WSO2 ESB - JMS response from endpoint with XML payload shows up as Text
body: <p>I am using WSO2 ESB to send a JMS message (XML payload) to an endpoint and then to read a return JMS message (on another queue) from the same endpoint (which also sends an XML payload). The problem I am facing is that the return JMS message from the endpoint, even though it is an XML payload, comes in as a text message. </p>
  
  <p>Here is what I see in WSO2 for the JMS message (with XML payload) sent back by the endpoint:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soapenv:Body&gt;
  &lt;axis2ns2:text xmlns:axis2ns2="http://ws.apache.org/commons/ns/payload"&gt;
  &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
  &amp;lt;Sys1Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Sys1-ack-nack.xsd"&amp;gt;
      &amp;lt;security&amp;gt;
              &amp;lt;statusInfo&amp;gt;
                      &amp;lt;ARMStatus&amp;gt;ARM_ACK&amp;lt;/ARMStatus&amp;gt;
                      &amp;lt;Sys1Status&amp;gt;Sys1_ACK&amp;lt;/Sys1Status&amp;gt;
                      &amp;lt;FinalStatus&amp;gt;ACK&amp;lt;/FinalStatus&amp;gt;
              &amp;lt;/statusInfo&amp;gt;
              &amp;lt;upstreamIdentifier&amp;gt;
                      &amp;lt;tradeId&amp;gt;459609&amp;lt;/tradeId&amp;gt;
                      &amp;lt;messageId&amp;gt;12345678&amp;lt;/messageId&amp;gt;
                      &amp;lt;assetId&amp;gt;6M2&amp;lt;/assetId&amp;gt;
                      &amp;lt;issueDescription&amp;gt;IRS RTP 3.12 19MAY11 JP&amp;lt;/issueDescription&amp;gt;
                      &amp;lt;productType&amp;gt;SWAPTION&amp;lt;/productType&amp;gt;
              &amp;lt;/upstreamIdentifier&amp;gt;
      &amp;lt;/security&amp;gt;
   &amp;lt;/Sys1Response&amp;gt;
  &lt;/axis2ns2:text&gt;
  &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>This is the WSO2 proxy definition.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
     &lt;registry provider="org.wso2.carbon.mediation.registry.ESBRegistry"&gt;
        &lt;parameter name="localRegistry"&gt;/&lt;/parameter&gt;
        &lt;parameter name="cachableDuration"&gt;15000&lt;/parameter&gt;
     &lt;/registry&gt;
     &lt;proxy name="ToWSO2"
            transports="jms"
            startOnLoad="true"
            trace="disable"&gt;
        &lt;description/&gt;
        &lt;target&gt;
           &lt;inSequence&gt;
              &lt;property name="transport.jms.ContentTypeProperty"
                        value="Content-Type"
                        scope="axis2"/&gt;
              &lt;log level="full"/&gt;
              &lt;call&gt;
                 &lt;endpoint&gt;
                    &lt;address uri="jms:/ToSys1?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;amp;java.naming.provider.url=tcp://localhost:61616&amp;amp;transport.jms.DestinationType=queue&amp;amp;transport.jms.ReplyDestinationType=queue&amp;amp;transport.jms.ReplyDestination=FromSys1&amp;amp;transport.jms.ContentType=application/xml"/&gt;
                 &lt;/endpoint&gt;
              &lt;/call&gt;
              &lt;log level="full"/&gt;
           &lt;/inSequence&gt;
           &lt;outSequence&gt;
              &lt;log level="full"/&gt;
              &lt;drop/&gt;
           &lt;/outSequence&gt;
        &lt;/target&gt;
        &lt;parameter name="transport.jms.ContentType"&gt;
           &lt;rules&gt;
              &lt;jmsProperty&gt;contentType&lt;/jmsProperty&gt;
              &lt;default&gt;application/xml&lt;/default&gt;
           &lt;/rules&gt;
        &lt;/parameter&gt;
        &lt;parameter name="transport.jms.Destination"&gt;ToWSO2&lt;/parameter&gt;
     &lt;/proxy&gt;
     &lt;sequence name="fault"&gt;
        &lt;log level="full"&gt;
           &lt;property name="MESSAGE" value="Executing default 'fault' sequence"/&gt;
           &lt;property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/&gt;
           &lt;property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/&gt;
        &lt;/log&gt;
        &lt;drop/&gt;
     &lt;/sequence&gt;
     &lt;sequence name="main"&gt;
        &lt;in&gt;
           &lt;log level="full"/&gt;
           &lt;filter source="get-property('To')" regex="http://localhost:9000.*"&gt;
              &lt;send/&gt;
           &lt;/filter&gt;
        &lt;/in&gt;
        &lt;out&gt;
           &lt;send/&gt;
        &lt;/out&gt;
        &lt;description&gt;The main sequence for the message mediation&lt;/description&gt;
     &lt;/sequence&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>Would appreciate help in resolving this. Many thanks in advance!</p>