Dynamic 在WSO2 ESB中动态更改端点地址

Dynamic 在WSO2 ESB中动态更改端点地址,dynamic,wso2,uri,wso2esb,endpoint,Dynamic,Wso2,Uri,Wso2esb,Endpoint,如何动态设置端点地址 我在运行时在属性中设置端点地址,并且需要用它的值替换端点地址的URI 如何使用此值设置地址的URI值?用于使用从分配的属性中提取的值设置“to”地址头 使用Header meditaor设置“to”头并使用默认端点..检查示例。当服务器不发布其WSDL时,请参阅Myobis注释。尝试但未成功。您可以像 <endpoint xmlns="http://ws.apache.org/ns/synapse" name="MyEndpoint"> <http

如何动态设置端点地址

我在运行时在属性中设置端点地址,并且需要用它的值替换端点地址的URI


如何使用此值设置地址的URI值?

用于使用从分配的属性中提取的值设置“to”地址头

使用Header meditaor设置“to”头并使用默认端点..检查示例。

当服务器不发布其WSDL时,请参阅Myobis注释。尝试但未成功。

您可以像

<endpoint xmlns="http://ws.apache.org/ns/synapse" name="MyEndpoint">
   <http uri-template="{uri.var.full}?f={uri.var.f}{+uri.var.extra}" method="put">
   </http>
</endpoint>

。。然后将其另存为&或者使用javascript设置属性)

这个方法对我来说是正确的

我需要创建下面的动态url

{动态参数}

在端点url中是这样的

<inSequence>
   <property name="uri.var.servicepath" scope="default" type="STRING" 
   value="test"/>

   <send>
      <endpoint key="SurepayVASAppsEP"/>
    </send>
</inSequence>
{uri.var.servicepath}

将“test”变量设置为my动态参数(如果需要设置表达式值,请进行设置)。在属性中介中设置“test”值。(我做了这个insideproxy服务)


创建端点

在这里,我创建了HTTP端点

<endpoint name="ServiceEP" xmlns="http://ws.apache.org/ns/synapse">
   <http method="post" uri-template="http://localhost:8787/{uri.var.servicepath}"/>
</endpoint>

然后将该端点添加到代理服务或API中

<send>
   <endpoint key="ServiceEP"/>
</send>

最后你的代理看起来像这样

<inSequence>
   <property name="uri.var.servicepath" scope="default" type="STRING" 
   value="test"/>

   <send>
      <endpoint key="SurepayVASAppsEP"/>
    </send>
</inSequence>

这样,您可以更改每个url参数。Ex-:

http://{uri.var.hostname}:{uri.var.port}/{uri.var.servicepath}


谢谢Shelan Perera先生的快速回复。我在这个问题上使用了header mediator,但我想使用端点工件,以便在需要时有更多的灵活性。如何在端点中使用xpath表达式?我使用了端点模板,但在控制台中从模板创建端点时,只能在其参数中设置值字段而不是表达式。我还创建了端点bye address,并使用get属性('EPadd')设置表达式,但它不起作用。我不知道在创建EndPopint时应该在Xpath字段中写什么!那个样品对我有用!我所做的唯一改变就是从顶部移除和标记,然后将它们添加到底部的标记中。看起来是这样的:如果URI不是http?
<send>
   <endpoint key="ServiceEP"/>
</send>
<inSequence>
   <property name="uri.var.servicepath" scope="default" type="STRING" 
   value="test"/>

   <send>
      <endpoint key="SurepayVASAppsEP"/>
    </send>
</inSequence>