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

时间:2014-11-04 17:02:46

标签: wso2 wso2esb

我正在使用WSO2 ESB将JMS消息(XML有效负载)发送到端点,然后从同一端点(也发送XML有效负载)读取返回JMS消息(在另一个队列上)。我面临的问题是来自端点的返回JMS消息,即使它是XML有效负载,也是作为文本消息提供的。

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

<?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>

非常感谢帮助您解决这个问题。非常感谢提前!

0 个答案:

没有答案