wso2 属性 到端点的地址
wso2 property to endpoint's address
我想做的是获取 属性 的值并将其放入端点的 uri
我的属性
<property value="1" name="id" scope="default" type="STRING"/>
我的端点地址
<address format="rest" uri="http://localhost:port/service?id={id}"/>
可能有不同的解决方案,但一个技巧是使用 uri 的值设置 'To' header,然后调用发送调解器。像这样:
<header name="To" expression="fn:concat('http://localhost:port/service?id=', get-property('id'))"/>
<send/>
您可以使用 http 端点实现此目的,
<property name="uri.var.id" value="1" type="STRING"/>
<send>
<endpoint>
<http uri-template="http://localhost:port/service?id={uri.var.id}"/>
</endpoint>
</send>
我想做的是获取 属性 的值并将其放入端点的 uri
我的属性
<property value="1" name="id" scope="default" type="STRING"/>
我的端点地址
<address format="rest" uri="http://localhost:port/service?id={id}"/>
可能有不同的解决方案,但一个技巧是使用 uri 的值设置 'To' header,然后调用发送调解器。像这样:
<header name="To" expression="fn:concat('http://localhost:port/service?id=', get-property('id'))"/>
<send/>
您可以使用 http 端点实现此目的,
<property name="uri.var.id" value="1" type="STRING"/>
<send>
<endpoint>
<http uri-template="http://localhost:port/service?id={uri.var.id}"/>
</endpoint>
</send>