You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Kallen McInerney <ka...@marketamerica.com> on 2012/06/01 01:14:02 UTC
RESTBindingInvoker and array parameters
I have a component that uses a REST binding. One of the parameters is an array of Integers. When I make a REST call via jersey-client the array is received correctly (i.e. ids=1&ids=2&ids=3). However when I call the service through it's Java interface the Integer array is malformed. Inside RESTBindingInvoker you can see the final URI and the problem. Drilling down it seems that apache wink's URIBuilder.queryParam() doesn't work with arrays.
In short a service like
@GET
@PATH("Test")
@Produces(MediaType.APPLICATION_JSON)
public void doSomething(@QueryParam("ids") Integer IDs[]);
called natively like
service.doSomething(new Integer[]{1,2,3});
produces in RESTBindingInvoker a uri that looks like
http://localhost:8085/Test?ids=%5BLjava.lang.Integer;@6d80af
Is the only fix here to contribute a fix to apache wink or am I missing something? Jersey-server appears to handle arrays correctly
Kallen McInerney
Principal Engineer
Email: kallenm@shop.com<ma...@shop.com>
Phone: (831) 531-4811
Skype: kallen.mcinerney
SHOP*COMTM
A Market America Company
Shop Smart, Save Big(tm)
<http://www.shop.com/>www.shop.com<http://www.shop.com/>
Join us on Facebook<http://www.facebook.com/Shop.com>.
Follow us on Twitter<http://twitter.com/shopcom>.
Read The Shopping Vine<http://theshoppingvine.com/>.