After completing the example, here is the configuration I used:
-- defining the endpoint (right click on the example->endpoint->create new endpoint) --
<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>
-- my API definition (right click on the example->API Rest->Create new API Rest)
<?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="Welcome to HealthcareService"/>
</log>
<send>
<endpoint key="QueryDoctorEP"/>
</send>
</inSequence>
<outSequence>
<send/>
</outSequence>
<faultSequence/>
</resource>
</api>
Now, we wait for the server to deploy the configuration...
the request: (my offset is 3)
curl -v http://localhost:8283/healthcare/querydoctor/surgery
Here is the response from curl
About to connect() to localhost port 8283 (#0)
* Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8283 (#0)
> GET /healthcare/querydoctor/surgery HTTP/1.1
> User-Agent: curl/7.25.0 (i386-pc-win32) libcurl/7.25.0 OpenSSL/0.9.8u zlib/1.2.6 libssh2/1.4.0
> Host: localhost:8283
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 26 Jan 2017 16:00:51 GMT
< Transfer-Encoding: chunked
<
[{"name":"thomas collins","hospital":"grand oak community hospital","category":"surgery","availability":"9.00 a.m - 11.00 a.m","fee":7000.0},{"name":"anne clement","hospital":"clemency
medical center","category":"surgery","availability":"8.00 a.m - 10.00 a.m","fee":12000.0},{"name":"seth mears","hospital":"pine valley community hospital","category":"surgery","availa
bility":"3.00 p.m - 5.00 p.m","fee":8000.0}]* Connection #0 to host localhost left intact
* Closing connection #0