WSO2 ESB 教程错误

WSO2 ESB Tutorial Error

我在这里发现了完全相同的问题,但没有答案,没有答案我无法继续解决这个问题。

WSO2 Start - up (Sending Simple Message)

我尝试使用的示例托管在 http://wso2training-restsamples.wso2apps.com, and the tutorial is this one: https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message

的 WSO2 App Cloud 中

据我所知,我严格按照教程进行操作,但是当我开始发送 GET 请求时,虽然它在执行此命令后登录到 Eclipse 控制台,但在我的控制台上:

curl -v http://localhost:8280/healthcare/querydoctor/surgery

我明白了

Exception occurred :Illegal character in path at index 12: /healthcare/{uri.var.category}* Connection #0 to host localhost left intact

HealthCareAPI.xml:

<?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="Request Log" level="custom">
                <property name="message" value="&quot;Welcome to HealthcareService&quot;"/>
            </log>
            <send>
                <endpoint key="QueryDoctorEP"/>
            </send>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>

QueryDoctorEP.xml:

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

您的端点 url-template 有错字(末尾多了一个 space)。注意不要在模板的开头或结尾包含白色space。

uri-template="http://wso2training-restsamples.wso2apps.com/healthcare/{uri.var.category}"

删除它,你应该得到预期的输出。