Skip to content

Instantly share code, notes, and snippets.

@Asitha
Created August 13, 2017 14:29
Show Gist options
  • Select an option

  • Save Asitha/0938415a567e3c54ca72f2337e4048f8 to your computer and use it in GitHub Desktop.

Select an option

Save Asitha/0938415a567e3c54ca72f2337e4048f8 to your computer and use it in GitHub Desktop.
Using query.param property to retrieve query parameters with WSO2 ESB. Details can be found at http://asitha.github.io/cs/programming/wso2/esb/mediators/2017/08/14/get-query-params-with-wso2-esb/
<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="StoreAPI" context="/store">
<resource methods="GET" uri-template="/view*">
<inSequence>
<!--Directly use in a payload factory as follows -->
<payloadFactory media-type="xml">
<format>
<user xmlns="">
<name>$1</name>
<age>$2</age>
</user>
</format>
<args>
<arg evaluator="xml" expression="get-property('query.param.name')"/>
<arg evaluator="xml" expression="get-property('query.param.age')"/>
</args>
</payloadFactory>
<respond/>
</inSequence>
</resource>
</api>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment