用 wso2esb 中的 get-property 替换函数 [英] replace function with get-property in wso2esb
问题描述
我正在尝试以下选项,但出现错误,谁能建议我解决方案.我添加了 synapse.xpath.dom.failover.enabled=true代码:试图用属性值替换~TOKEN~
I am trying the below option and i m getting error, can anyone suggest me the solution. I have added synapse.xpath.dom.failover.enabled=true Code:trying to replace ~TOKEN~ with the property value
<property name="verificationLink" expression="fn:replace($ctx:reqVerifyUrl , '~TOKEN~', get-property('verification_code'))" scope="default" type="STRING" xmlns:fn="http://www.w3.org/2005/xpath-functions" />
错误:
TID: [-1234] [] [2017-02-15 00:14:19,318] ERROR {org.apache.synapse.util.xpath.SynapseXPath} - Evaluation of the XPath expression fn:replace($ctx:reqVerifyUrl , '~TOKEN~', get-property('verification_code')) resulted in an error {org.apache.synapse.util.xpath.SynapseXPath} net.sf.saxon.trans.XPathException: Unknown system function get-property()
推荐答案
get-property 不是标准的 xpath 函数,你必须对 xpath 引擎说这个函数来自突触:
get-property is not a standard xpath function and you must say to the xpath engine that this function comes from synapse :
<property name="verificationLink" expression="fn:replace($ctx:reqVerifyUrl , '~TOKEN~', syn:get-property('verification_code'))" scope="default" type="STRING" xmlns:fn="http://www.w3.org/2005/xpath-functions" />
你不需要添加'syn'命名空间的定义,它在你的中介中是众所周知的(xmlns:syn="http://ws.apache.org/ns/synapse")
You do not need to add the definition of 'syn' namespace, it is well known in your mediation (xmlns:syn="http://ws.apache.org/ns/synapse")
这篇关于用 wso2esb 中的 get-property 替换函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!