2
votes

Hi I'm testing WSO2 ESB Rest Api capabilities, it work for me if I use only one param defined in URI-Template like this:

<resource methods="GET" uri-template="/testwso2/{symbol}?arg1={value1}">

I was able to put {symbol} and {value1} in a db using DBreport mediator with a sequence like

...
<sql>INSERT into testWSO2 values ('PARAM',?,?)</sql>
<parameter expression="get-property('query.param.arg1')" type="VARCHAR"/>
<parameter expression="get-property('uri.var.symbol')" type="VARCHAR"/>
...

but if try to add more parameter in uri-template (separated by &, like "..arg1={value1}&arg2={value2}" it doesn't work!

I follow sample "specific use case" in WSO2 ESB doc about to get parameters for query like "customer?parm1=value1&param2=value2", but I found it's not completed well defined.

Where is my error? How I must define uri template correctly to solve my problem? thks in advance.

Giovanni

1
Did you try &amp; instead of & ?Marc
Please answer this question and mark it as the solution.Isuru Perera

1 Answers

0
votes

I solved it... calling REST API with command line curl with more parameter (then using & in query string) need to be enclosed between quotes, so now my call curl -v "http://localhost:8280/storeqparam/testwso2/IBM?arg1=13&arg2=12" works fine! :-)