Java 如何在WSO2 ESB中读取http POST请求负载数据

Java 如何在WSO2 ESB中读取http POST请求负载数据,java,web-services,wso2,wso2esb,wso2carbon,Java,Web Services,Wso2,Wso2esb,Wso2carbon,我是wso2 esb的新手。我知道如何读取http url参数。我要求我的代理将接收包含有效负载数据的http POST请求。我想知道如何在代理中读取POST有效负载数据。?如果您只想执行REST到SOAP的转换,则不需要读取消息正文。这是一个样本突触配置 <api xmlns="http://ws.apache.org/ns/synapse" name="TestAPI" context="/test"> <resource methods="POST GET">

我是wso2 esb的新手。我知道如何读取http url参数。我要求我的代理将接收包含有效负载数据的http POST请求。我想知道如何在代理中读取POST有效负载数据。?

如果您只想执行REST到SOAP的转换,则不需要读取消息正文。这是一个样本突触配置

<api xmlns="http://ws.apache.org/ns/synapse" name="TestAPI" context="/test">
   <resource methods="POST GET">
      <inSequence>
         <property name="SOAPAction" value="" scope="transport"/>
         <send>
            <endpoint>
               <address uri="http://demo8290629.mockable.io/test" format="soap11"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </resource>
</api>

你可以这样称呼它

curl -H "Content-Type:application/xml" -d '<ns:operationRequest xmlns:ns="http://demo8290629.mockable.io/service/1">testing</ns:operationRequest>' http://172.17.0.1:8280/test
<property name="payload" expression="$body"/>
curl-H“内容类型:应用程序/xml”-d“测试”http://172.17.0.1:8280/test
但是,如果要将消息读取到属性,可以这样做

curl -H "Content-Type:application/xml" -d '<ns:operationRequest xmlns:ns="http://demo8290629.mockable.io/service/1">testing</ns:operationRequest>' http://172.17.0.1:8280/test
<property name="payload" expression="$body"/>


您想对有效负载做什么?欢迎使用stackoverflow。我投票结束这个问题,因为它太广泛了。您应该发布相关代码,以至少证明您尝试了多远…@Bhathiya输入xml数据是通过http post请求从客户端有效负载中发送的。所以,我想在wso2 esb中读取这些数据。你明白了吗?我明白那部分。我的问题是你看完后打算做什么。我这样问是因为您的阅读方式可能会有所不同,这取决于您将如何处理它。@Bhathiya我将使用payloadFactory中介器将有效负载xml包装在soap主体中,然后将其发送到端点。请告诉我答案