繁体   English   中英

从WSO2代理中删除肥皂信封

[英]Removing soap envelope from WSO2 proxy

默认情况下,来自WSO2代理服务的每个出站消息都被一个肥皂信封包裹。

有可能通过配置删除它吗? 我希望从不带SOAP信封的代理服务转换的消息。

我不想编写另一个类来处理此问题。

    <proxy xmlns="http://ws.apache.org/ns/synapse" name="risresult" transports="https,http,jms" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="ContentType" value="text/plain" scope="default" type="STRING"/>
         <class name="com.test.guru.HL7RISPrescription"/>
         <property name="RESPONSE" value="true"/>
         <header name="To" action="remove"/>
            <send>
                <endpoint>
                    <address uri="jms:/prescription?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616" format="pox" />
                </endpoint>
            </send>
      </inSequence>
      <outSequence>
         <drop/>
      </outSequence>
      <faultSequence/>
   </target>
   <parameter name="transport.jms.ContentType">
      <rules>                           
         <jmsProperty>contentType</jmsProperty>                           
         <default>application/xml</default>                  
      </rules>
   </parameter>
   <description></description>
</proxy>

问候宗师@gnanagurus

您可以使用

  format="pox" 

将XML发送到端点,请参阅以下博客文章以获取更多详细信息。

http://charithaka.blogspot.com/2010/07/message-format-transformations-with.html

您需要在发送介体上方添加以下属性,以从消息中删除肥皂信封。

<property name="messageType" value="application/xml" scope="axis2" type="STRING"/>

我使用以下示例代理对其进行了测试,并且对我有用。

<?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="test"
           transports="https,http"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
       <target>
          <inSequence>

             <property name="messageType"
                       value="application/xml"
                       scope="axis2"
                       type="STRING"/>
             <log level="full"/>
             <send>
                <endpoint>
                   <address uri="http://www.google.com"/>
                </endpoint>
             </send>
          </inSequence>
       </target>
       <description/>
    </proxy>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM