在 wso2 esb 中标注并发送调解器

Callout and send mediator in wso2 esb

任何人都可以用通用示例解释 callout 调解器的作用吗? 以及如何配置源和目标? 标注调解器与发送调解器有何不同?

'source' 使用 XPath 表达式(我们可以 select 想要的 xml 节点作为请求发送)或注册表项(我们可以在其中将请求消息存储在注册表中)。 'target' 指定一个节点,在当前消息上下文中,生成的有效负载(响应)将附加到该节点。

callout mediator 和 send mediator 的区别在于 callout mediator 会return通过阻塞调用来响应相同的序列。所以 callout mediator 保持线程直到事务完成。

在发送调解器响应中 returned 到 OutSequence,您可以在其中将其发送回 client.So 线程将立即释放发送消息。

This is a good blog 在哪里可以找到用法。

你可以在WSO2 Documentation of the Callout Mediator中找到很好的解释。

  • 源:定义请求的负载。可以使用三个选项(XPath、属性、Envelope)来定义有效负载的来源。大多数时候我们使用信封来发送完整的内容。
  • 目标:定义应存储响应的位置。有一些选项(XPath 和 属性),可以在当前消息中或在 属性 中设置响应。

这是一个我们经常用来发送全部内容并将响应存储在 属性 中的简单示例:

<callout serviceURL="http://wsf.cdyne.com/WeatherWS/Weather.asmx" action="http://ws.cdyne.com/WeatherWS/GetWeatherInformation">  
     <source type="envelope"/>
     <target key="response"/>
</callout>

<!-- print the response property -->
<log level="custom">
    <property name="response" expression="get-property('response')"/>  
</log>

You can find another example here