首页 > 解决方案 > 带有 x-www-form-urlencoded 消息类型服务调用的 WSO2 ESB

问题描述

我使用以下代码将 x-www-form-urlencoded 消息发送到支持的服务器。

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="FormDataReceiver">
   <http uri-template="http://www.eaipatterns.com/MessageEndpoint.html" method="post">
      <suspendOnFailure>
         <progressionFactor>1.0</progressionFactor>
      </suspendOnFailure>
      <markForSuspension>
         <retriesBeforeSuspension>0</retriesBeforeSuspension>
         <retryDelay>0</retryDelay>
      </markForSuspension>
   </http>
</endpoint>

还使用了以下 API 代码。

<api xmlns="http://ws.apache.org/ns/synapse" name="FORM" context="/Service">
   <resource methods="POST">
      <inSequence>
         <log level="full"></log>
         <property name="name" value="Mark" scope="default" type="STRING"></property>
         <property name="company" value="wso2" scope="default" type="STRING"></property>
         <property name="country" value="US" scope="default" type="STRING"></property>
         <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                  <soapenv:Body>
                     <root xmlns="">
                        <name>$1</name>
                        <company>$2</company>
                        <country>$3</country>
                     </root>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="$ctx:name"></arg>
               <arg evaluator="xml" expression="$ctx:company"></arg>
               <arg evaluator="xml" expression="$ctx:country"></arg>
            </args>
         </payloadFactory>
         <log level="full"></log>
         <property name="messageType" value="application/x-www-form-urlencoded" scope="axis2" type="STRING"></property>
         <property name="DISABLE_CHUNKING" value="true" scope="axis2" type="STRING"></property>
         <call>
            <endpoint key="FormDataReceiver"></endpoint>
         </call>
         <respond></respond>
      </inSequence>
   </resource>
</api>

但是该消息仍然以休息呼叫方式发送。

我想要将消息正文跟随到支持的服务器中。此示例消息应通过消息正文发送。在这里,我使用了 WSO2 Given Example。我添加了相同的 wso2esb 链接供您进一步参考。wso2。实际上我需要发送消息 XML={{my_xml_message_here}}。请帮我继续这个。非常感谢。

name=Mark&company=wso2

标签: restsoapwso2wso2esbwso2ei

解决方案


推荐阅读