1
votes

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)

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

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:

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:

<?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>
1
Can you provide the xml for the HealthCareAPI in your project?Rodrigo Vasconcelos
And the endpoint xml as wellRodrigo Vasconcelos
@RodrigoVasconcelos added to question.Edhelvar

1 Answers

3
votes

You have a typo (an extra space at the end) in your endpoint 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.