Hi I'm new to Synapse and could really use a leg up. I'm experimenting
with using Synapse as a REST API "gateway". For this experiment I'm
trying to pass a Wikipedia REST API call through Synapse basically
unmodified.
I can use cURL for the Wikipedia REST API like this
curl
"http://en.wikipedia.org/w/api.php?&action=query&titles=Apache%20Synapse&format=json"
and get this JSON back.
{"query":{"pages":{"17911473":{"pageid":17911473,"ns":0,"title":"Apache
Synapse"}}}}
What would the required synapse.xml be to setup a dumb gateway for this
API? If this works I would expect the following curl to return the same
result as the previous curl.
curl
"http://localhost:8280/wiki/synapse?&action=query&titles=Apache%20Synapse&format=json"
Here is one of the synapse variants that I have tried. I love to write
this up as a sample to contribute if I can get it working.
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<api name="wikipedia" context="/wiki">
<resource uri-template="/synapse" methods="GET">
<inSequence>
<log level="full"/>
<send>
<endpoint>
<address uri="http://en.wikipedia.org/w/api.php"
format="get"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</resource>
</api>
</definitions>