【问题标题】:Get the response after a send in sequence in WSO2ESB在 WSO2ESB 中按顺序发送后获取响应
【发布时间】:2015-12-08 16:18:32
【问题描述】:

如何获得从代理返回响应的序列?我尝试过呼叫、标注、发送和响应。我的客户提出服务请求并得到 200 响应。我的端点服务被调用,但它的响应似乎被丢弃了。如果我使用直通代理(即没有序列)一切都可以,但是我没有日志中介或统计信息。

<?xml version="1.0" encoding="UTF-8"?>
<sequence name="sequence_myservice" trace="enable" xmlns="http://ws.apache.org/ns/synapse">
    <log separator="">
    </log>
    <send>
       <endpoint key="conf:/myservice"/>
    </send>
</sequence>

【问题讨论】:

  • 已解决 - 应该(重新)阅读文档,需要输入/输出。对不起,如果我浪费了任何人的时间。

标签: wso2 wso2esb


【解决方案1】:

您需要在序列中使用&lt;in&gt; and &lt;out&gt; mediators,检查documentation of in and out mediators

  • 在 inSequence 中构建您的请求并调用 &lt;send&gt; 调解器
  • 您将在 outSequence 中获得响应

这是一个代码示例:

<sequence name="main" xmlns="http://ws.apache.org/ns/synapse">
    <in>
        <log level="full"/>
        <send>
            <endpoint>
                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            </endpoint>
        </send>
    </in>
    <out>
        <!-- here is your response -->
        <send/>
    </out>
</sequence>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-16
    • 1970-01-01
    • 2013-09-27
    • 2017-07-14
    • 2021-11-07
    • 2012-09-02
    • 1970-01-01
    相关资源
    最近更新 更多