我是 WSO2 esb 的新手。我想创建一个 api,我想在其中添加一个从 api Url 到端点 url 的动态参数。
我的终点网址就像http://example.com/api/sync/{session_id}.json
我试图创建像
<api name="rest" context="/sync">
<resource methods="GET" uri-template="/{id}">
<inSequence>
<log level="full">
<property xmlns:ns="http://org.apache.synapse/xsd"
name="uri.var.session"
expression="get-property('uri.var.id')"
scope="axis2"/>
</log>
<property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
<send>
<endpoint name="Mecars">
<http trace="enable"
method="get"
uri-template="http://example.com/sync/{+uri.var.session}.json"/>
</endpoint>
</send>
</inSequence>
</resource>
</api>
在日志中,我得到了 uri.var.session 的值但是在端点 Uri-template 上它没有附加。
请指导我如何将 api uri-template 中的 {id} 值附加到端点 uri-template?