来自具有XML负载的端点的WSO2 ESB-JMS响应显示为文本

来自具有XML负载的端点的WSO2 ESB-JMS响应显示为文本,wso2,wso2esb,Wso2,Wso2esb,我使用WSO2 ESB向端点发送JMS消息XML负载,然后从同一端点读取另一个队列上的返回JMS消息,该端点也发送XML负载。我面临的问题是,来自端点的返回JMS消息(即使是XML负载)以文本消息的形式出现 以下是我在WSO2中看到的端点发送回XML有效负载的JMS消息: <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/

我使用WSO2 ESB向端点发送JMS消息XML负载,然后从同一端点读取另一个队列上的返回JMS消息,该端点也发送XML负载。我面临的问题是,来自端点的返回JMS消息(即使是XML负载)以文本消息的形式出现

以下是我在WSO2中看到的端点发送回XML有效负载的JMS消息:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<axis2ns2:text xmlns:axis2ns2="http://ws.apache.org/commons/ns/payload">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Sys1Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Sys1-ack-nack.xsd"&gt;
    &lt;security&gt;
            &lt;statusInfo&gt;
                    &lt;ARMStatus&gt;ARM_ACK&lt;/ARMStatus&gt;
                    &lt;Sys1Status&gt;Sys1_ACK&lt;/Sys1Status&gt;
                    &lt;FinalStatus&gt;ACK&lt;/FinalStatus&gt;
            &lt;/statusInfo&gt;
            &lt;upstreamIdentifier&gt;
                    &lt;tradeId&gt;459609&lt;/tradeId&gt;
                    &lt;messageId&gt;12345678&lt;/messageId&gt;
                    &lt;assetId&gt;6M2&lt;/assetId&gt;
                    &lt;issueDescription&gt;IRS RTP 3.12 19MAY11 JP&lt;/issueDescription&gt;
                    &lt;productType&gt;SWAPTION&lt;/productType&gt;
            &lt;/upstreamIdentifier&gt;
    &lt;/security&gt;
 &lt;/Sys1Response&gt;
</axis2ns2:text>
</soapenv:Body>
</soapenv:Envelope>
这是WSO2代理定义

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <registry provider="org.wso2.carbon.mediation.registry.ESBRegistry">
      <parameter name="localRegistry">/</parameter>
      <parameter name="cachableDuration">15000</parameter>
   </registry>
   <proxy name="ToWSO2"
          transports="jms"
          startOnLoad="true"
          trace="disable">
      <description/>
      <target>
         <inSequence>
            <property name="transport.jms.ContentTypeProperty"
                      value="Content-Type"
                      scope="axis2"/>
            <log level="full"/>
            <call>
               <endpoint>
                  <address uri="jms:/ToSys1?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616&amp;transport.jms.DestinationType=queue&amp;transport.jms.ReplyDestinationType=queue&amp;transport.jms.ReplyDestination=FromSys1&amp;transport.jms.ContentType=application/xml"/>
               </endpoint>
            </call>
            <log level="full"/>
         </inSequence>
         <outSequence>
            <log level="full"/>
            <drop/>
         </outSequence>
      </target>
      <parameter name="transport.jms.ContentType">
         <rules>
            <jmsProperty>contentType</jmsProperty>
            <default>application/xml</default>
         </rules>
      </parameter>
      <parameter name="transport.jms.Destination">ToWSO2</parameter>
   </proxy>
   <sequence name="fault">
      <log level="full">
         <property name="MESSAGE" value="Executing default 'fault' sequence"/>
         <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
         <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
      </log>
      <drop/>
   </sequence>
   <sequence name="main">
      <in>
         <log level="full"/>
         <filter source="get-property('To')" regex="http://localhost:9000.*">
            <send/>
         </filter>
      </in>
      <out>
         <send/>
      </out>
      <description>The main sequence for the message mediation</description>
   </sequence>
</definitions>

希望您能帮助解决此问题。非常感谢

你在哪里设置这个参数,你能分享你的代理xml定义吗?Jean-Michel:我已经将代理xml定义添加到了原始帖子中。