wso2esb 中是否有替换功能? [英] Is there any replace function in wso2esb?
问题描述
我有类似的字符串htt://api.orgsync.com/orgs/{orgId}/events?key={orgSyncKey}&startdate={startDate}&enddate={endDate}
我需要将 {orgId} 替换为 1234,将 {orgSyncKey} 替换为 2345,将 {startDate} 替换为 12/01/2004,将 {endDate} 替换为 15/02/2005.
i need to replace {orgId} with 1234, {orgSyncKey} with 2345 , {startDate} with 12/01/2004 and {endDate} with 15/02/2005.
wso2esb 中是否有任何 replace 类型的函数?
is there any replace kind of function in wso2esb?
推荐答案
replace
是 XPath 2.0 附带的一个函数.要启用 XPath 2.0 功能,请取消注释位于 $ESB_HOME/repository/conf 目录下的 synapse.properties 文件中的以下条目.
replace
is a function that comes with XPath 2.0. To enable XPath 2.0 functions uncomment the following entry in the synapse.properties file which is located at $ESB_HOME/repository/conf directory.
synapse.xpath.dom.failover.enabled=true
那么你必须如下指定中介者,
then you have to specify the mediator as follows,
<property
expression="fn:replace('your_original_string', 'pattern_to_replace', 'your_new_string')"
name="NEWSTRING" scope="default" type="STRING"
xmlns:fn="http://www.w3.org/2005/xpath-functions" />
这篇关于wso2esb 中是否有替换功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!