I have a resting endpoint in WSO2ESB (4.8), I need to read the query parameter in order to set the dynamic payload as my company. But I could not read it due to a newer one using wso2 ESB.Any?
Below is the code below.
<api xmlns="http://ws.apache.org/ns/synapse" name="sample" context="/api/sample"> <resource methods="OPTIONS GET" uri-template="/{val1}/groups/{val2}.json?q1={v1}&q2={v2}"> <inSequence> <property name="uri.var.q1" expression="$url:q1"></property> <property name="uri.var.q2" expression="$url:q2"></property> <property name="uri.var.val1" expression="get-property('uri.var.val1')"></property> <property name="uri.var.val2" expression="get-property('uri.var.val2')"></property> <send> <endpoint> <http method="GET" uri-template=""></http> </endpoint> </send> </inSequence> <outSequence> <send></send> </outSequence> </resource> </api>
Define a REST API inside the ESB and access the request parameters using get-property ('query.param.xxx') or get-property ('uri.var.yyy'), sample:
<resource methods="GET" uri-template="/testwso2/{symbol}?arg1={value1}"> get-property('query.param.arg1') get-property('uri.var.symbol')