【问题标题】:WSO2 ESB Tutorial ErrorWSO2 ESB 教程错误
【发布时间】:2017-12-01 21:19:26
【问题描述】:

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

WSO2 Start - up (Sending Simple Message)

我尝试使用的示例托管在 http://wso2training-restsamples.wso2apps.com 的 WSO2 App Cloud 中,教程是这样的:https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message

据我所知,我完全按照教程进行操作,但是当我开始发送 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>

【问题讨论】:

  • 您能提供项目中 HealthCareAPI 的 xml 吗?
  • 还有端点 xml
  • @RodrigoVasconcelos 添加到问题中。

标签: wso2 wso2esb esb


【解决方案1】:

您的端点url-template 中有错字(末尾有一个额外的空格)。注意不要在模板的开头或结尾包含空格。

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

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

【讨论】:

  • 哇,没想到会这么简单,谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-01-01
  • 1970-01-01
  • 2013-08-13
  • 1970-01-01
相关资源
最近更新 更多