首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >WSO2 ESB 6.1.1 -任何CApp都没有响应

WSO2 ESB 6.1.1 -任何CApp都没有响应
EN

Stack Overflow用户
提问于 2018-05-19 02:39:44
回答 1查看 52关注 0票数 1

我对这个应用程序还不熟悉,但是我已经尝试了一些教程,所有的教程都没有响应,什么也没有发生。我只是发送了一个请求,什么也没有。我按照教程的说明部署了所有内容,但当我尝试执行时,我的浏览或curl中没有显示任何内容。

下面是一个示例:

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<api context="/healthcare" name="HealthcareAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/querydoctor/{category}">
        <inSequence>
            <log description="RequestLog"/>
            <send/>
        </inSequence>
        <outSequence>
            <log description="ResponseLog"/>
            <send/>
        </outSequence>
        <faultSequence>
            <log description="ErrorLog"/>
        </faultSequence>
    </resource>
    <resource methods="POST" uri-template=" /categories/{category}/reserve">
        <inSequence>
            <property description="GetHospital" expression="json-eval($.hospital)" name="Hospital" scope="default" type="STRING"/>
            <switch source="get-property('Hospital')">
                <case regex="grand oak community hospital">
                    <log description="GrandOakLog" level="custom">
                        <property expression="fn:concat('Routing to ', get-property('Hospital'))" name="message"/>
                    </log>
                    <send/>
                </case>
                <case regex="clemency medical center">
                    <log description="ClemencyLog" level="custom">
                        <property expression="fn:concat('Routing to ', get-property('Hospital'))" name="message"/>
                    </log>
                    <send/>
                </case>
                <case regex="pine valley community hospital">
                    <log description="PineValleyLog" level="custom">
                        <property expression="fn:concat('Routing to ', get-property('Hospital'))" name="message"/>
                    </log>
                    <send/>
                </case>
                <default>
                    <log description="ErrorLog" level="custom">
                        <property expression="fn:concat('Invalid hospital - ', get-property('Hospital'))" name="message"/>
                    </log>
                    <respond description="RespondError"/>
                </default>
            </switch>
        </inSequence>
        <outSequence/>
        <faultSequence>
            <log description="ErrorLog"/>
        </faultSequence>
    </resource>
</api>


<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="ClemencyEP" xmlns="http://ws.apache.org/ns/synapse">
    <http method="post" uri-template="http://wso2training-restsamples.wso2apps.com/clemency/categories/{uri.var.category}/reserve"/>
</endpoint>

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="GrandOakEP" xmlns="http://ws.apache.org/ns/synapse">
    <http method="post" uri-template="http://wso2training-restsamples.wso2apps.com/grandoaks/categories/{uri.var.category}/reserve"/>
</endpoint>

<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="PineValleyEP" xmlns="http://ws.apache.org/ns/synapse">
    <http method="post" uri-template="http://wso2training-restsamples.wso2apps.com/pinevalley/categories/{uri.var.category}/reserve"/>
</endpoint>

下面是让应用程序正常工作的请求:

代码语言:javascript
运行
复制
{
  "patient": {
    "name": "John Doe",
    "dob": "1940-03-19",
    "ssn": "234-23-525",
    "address": "California",
    "phone": "8770586755",
    "email": "johndoe@gmail.com"
  },
  "doctor": "thomas collins",
  "hospital": "grand oak community hospital"
}
EN

回答 1

Stack Overflow用户

发布于 2018-06-08 02:21:45

您应该在send中介器中设置端点调用

代码语言:javascript
运行
复制
 <case regex="grand oak community hospital">
    <log description="GrandOakLog" level="custom">
        <property expression="fn:concat('Routing to ', get-property('Hospital'))" name="message"/>
    </log>
    <send>
        <endpoint name="GrandOakEP" xmlns="http://ws.apache.org/ns/synapse">
            <http method="post" uri-template="http://wso2training-restsamples.wso2apps.com/grandoaks/categories/{uri.var.category}/reserve"/>
        </endpoint>
    </send>
 </case>

此外,outSequence还应该有一个<send/>中介器

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50417436

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档