简体   繁体   English

WSO2 ESB教程错误

[英]WSO2 ESB Tutorial Error

I found the exact same problem here but there was no answer, and I can't move on with this without an answer. 我在这里发现了完全相同的问题,但没有答案,如果没有答案,我无法继续这样做。

WSO2 Start - up (Sending Simple Message) WSO2启动(发送简单消息)

The sample I'm trying to use is hosted in WSO2 App Cloud at http://wso2training-restsamples.wso2apps.com , and the tutorial is this one: https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message 我正在尝试使用的示例在http://wso2training-restsamples.wso2apps.com上的 WSO2 App Cloud中托管,教程如下: https//docs.wso2.com/display/ESB500/Sending+一个+简单+消息

As far as I know I followed the tutorial to the letter, but when I get to sending the GET request, although it logs in the Eclipse console, on my console, after doing this command: 据我所知,我遵循了教程中的字母,但是当我发送GET请求时,虽然它在我的控制台上登录Eclipse控制台后执行此命令:

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

I get this 我明白了

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

HealthCareAPI.xml: 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: 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>

You have a typo (an extra space at the end) in your endpoint url-template . 您的端点url-template有一个拼写错误(末尾有一个额外的空格)。 Be careful not to include whitespaces in the beggining or end of your templates. 注意不要在模板的开始或结尾包含空格。

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

Remove it and ou should get the expected output. 删除它,你应该得到预期的输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM