stWSO2ESB OutSequence处理 [英] stWSO2ESB OutSequence Processing

查看:124
本文介绍了stWSO2ESB OutSequence处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过WSO2ESB中的XSLT将XML请求转换为SOAP,只是想知道是否可以使请求参数可用于响应?

I'm transforming XML request to SOAP via XSLT in WSO2ESB, just wondering is it possible to make request parameter available to be used in response?

例如

<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也很陌生,任何人都可以启发我吗?

As you see, 123 isn't send to the server and has not received from the server. However, client is sending this parameter and i would like to just use this parameter in request and send back in response, is this possible? By how? I'm very new to synapse and very new to WSO2ESB, could anyone please enlighten me?

谢谢。

推荐答案

现在可以正常使用了。
只需通过将不连续和不连续的属性中介程序与XSLT一起添加即可,其中xslt试图从测试属性中获取值。就是这样!

Got it working now. Simply by adding the property mediator in both insequence and outsequence together with the XSLT, where the xslt is trying to get the value from test property. That's it!

不等

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

输出顺序

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

这篇关于stWSO2ESB OutSequence处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆