-->

stWSO2ESB OutSequence处理(stWSO2ESB OutSequence Proc

2019-08-02 02:57发布

我通过XSLT转换XML请求SOAP在WSO2ESB,只是不知道是否有可能使请求参数提供响应使用?

<request>
<test>123</test>
<param1>testing</param1>
</request>

- >转换为SOAP

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">#S:Body><ns2:testrequest xmlns:ns2="http://xml.testing.com/test"><teststring>testing</teststring></ns2:testrequest></S:Body></S:Envelope></soapenv:Body></soapenv:Envelope>

在响应

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:testresponse xmlns:ns2="http://xml.testing.com/test"><responsestring>success</responsestring></ns2:testresponse></S:Body></S:Envelope></soapenv:Body></soapenv:Envelope>

我想在XML返回

<responsestring>
<test>123</test>
<return1>success</return1>
</responsestring>

正如你看到的,123是不是发送给服务器,并没有从服务器接收。 但是,客户端发出此参数,我想只使用此参数请求发回响应,这可能吗? 通过怎么样? 我很新的突触和很新的WSO2ESB,任何人都可以告诉我吗?

谢谢。

Answer 1:

对的,这是可能的。 您可以使用属性调解 inSequence中设置所需的值作为一个属性,然后在outsequence使用它添加到响应充实调解员 。



Answer 2:

得到它现在的工作。 仅仅通过两个inSequence中添加属性调解员,并与XSLT,其中XSLT是试图从测试属性的值一起outsequence。 而已!

InSequence的

 <property xmlns:ns="http://org.apache.synapse/xsd" name="TEST" expression="//request/*[local-name()=test]" scope="default"/>

outsequence

<xslt key="xxxx.xslt">
<property name="test" expression="get-property('TEST')"/>
</xslt>


文章来源: stWSO2ESB OutSequence Processing