WSO2中的动态端点 [英] Dynamic Endpoint in WSO2
问题描述
我遇到一个问题,首先,我进行了一项服务,该服务将为结果提供特定的端点。获得特定的端点后,我想调用该服务。但是我不知道该怎么做。我尝试使用模板端点,但仍无法在Mediator中使用。我在以下文档中看到过该文档: http://wso2.org/ project / esb / java / 4.0.0 / docs / templates.html ,它说:使用端点模板是ESB中使用的端点配置的一种通用形式。与序列模板不同,端点模板始终使用' $'前缀值(即:-NOT xpath表达式)
I have an issue, Firstly, I make a Service that will give the result a specific endpoint. After I get the specific endpoint, I want to call that Service. But I don't know how to do it. I try the template Endpoint, but still cannot be used in Mediator. I have seen the documentation in : http://wso2.org/project/esb/java/4.0.0/docs/templates.html , and it said that "using Endpoint Template is a generalized form of endpoint configuration used in ESB. Unlike sequence templates , endpoint templates are always parameterized using '$' prefixed values (ie:- NOT xpath expressions)"
这是我的模板代码:
<template xmlns="http://ws.apache.org/ns/synapse" name="TemplateEndPoint">
<endpoint name="$name">
<address uri="$uri">
<suspendOnFailure>
<progressionFactor>1.0</progressionFactor>
</suspendOnFailure>
<markForSuspension>
<retriesBeforeSuspension>0</retriesBeforeSuspension>
<retryDelay>0</retryDelay>
</markForSuspension>
</address>
</endpoint>
</template>
这是代理的代码:
<send>
<endpoint template="TemplateEndPoint">
<parameter name="uri" value="http://localhost:8080/axis2/services/TaskService.TaskServiceHttpEndpoint/getTask" />
<parameter name="name" value="Testing" />
</endpoint>
</send>
当我在代理中对其进行硬编码时,它会接受代码,但是当我回头看时设计/源代码视图,它将返回。我该如何解决这个问题?
when I hard-code it in the proxy, It accept the code, but when I look back in design / source view, it will be back to . How Can I solve this problem?
推荐答案
我认为您正在寻找这个。您可以使用标题介体设置 To
参数
I think you are looking for this. You can set the To
parameter with header mediator
< header name = To expression = fn: concat('mailto:',get-property('email')) />
<header name="To" expression="fn:concat('mailto:', get-property('email'))"/>
您可以查看此链接以及
这篇关于WSO2中的动态端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!