简体   繁体   English

端点地址的wso2属性

[英]wso2 property to endpoint's address

What i am trying to do is get the value of property and put it in my endpoint's uri 我想做的就是获取属性的值并将其放入端点的uri中

my property 我的财产

<property value="1" name="id" scope="default" type="STRING"/>

my endpoint's address 我端点的地址

<address format="rest" uri="http://localhost:port/service?id={id}"/>

There might be different solutions but one trick is to set the 'To' header with the value of the uri and then just call the send mediator. 可能有不同的解决方案,但一种技巧是使用uri的值设置“ To”标头,然后仅调用发送中介程序。 Like so: 像这样:

<header name="To" expression="fn:concat('http://localhost:port/service?id=', get-property('id'))"/>
<send/>

You can achieve this using a http endpoint, 您可以使用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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM