You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by David Forden <fo...@gmail.com> on 2012/10/31 12:34:17 UTC

How can I pass parameters of type java.util.Set to a Wink JAX-RS service

I read in the Wink Developer Guide that it is possible to pass parameters of
type java.util.Set to Wink services. I have a requirement to pass a single
parameter of Set<String> into a Wink service. I assumed that something like
this might work:

	@Consumes(MediaType.APPLICATION_JSON)
	
	@Produces(MediaType.APPLICATION_JSON)		
	public BlahReturn getBlah(@QueryParam("getBlahInput") Set<String>
getBlahInput) {	
	...

I can't seem to be able to format the URL for the input correctly no matter
how I try. I always get a "HTTP Status 415" due to the request format. Any
ideas how to code a service like this and how to format the URL parameters
for the input as a JSON list?

Thanks in advance






--
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/How-can-I-pass-parameters-of-type-java-util-Set-to-a-Wink-JAX-RS-service-tp7572641.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.

Re: How can I pass parameters of type java.util.Set to a Wink JAX-RS service

Posted by Anton Piatek1 <an...@uk.ibm.com>.
What URL are you trying? It has been sometime since I tried this, and last 
time was just trying to pass an array to PHP, but http://somehost/path?a
[]=1&a[]=2&a[]=3 should work iirc

Regards, 

Anton


Anton Piatek



Websphere Message Broker Development / Test
Office:
Mailpoint:
Email:
Phone: 
DE3V21
MP 127, IBM Hursley Labs, Winchester, SO21 2JN
anton.piatek@uk.ibm.com
(Internal) 246557 (External) +44 (0)1962 816557
 Bluepages 
 Blog
Open Client for Debian Community developer

Blog   -   Wiki




From:   David Forden <fo...@gmail.com>
To:     wink-user@incubator.apache.org, 
Date:   31/10/2012 13:49
Subject:        How can I pass parameters of type java.util.Set to a Wink 
JAX-RS service



I read in the Wink Developer Guide that it is possible to pass parameters 
of
type java.util.Set to Wink services. I have a requirement to pass a single
parameter of Set<String> into a Wink service. I assumed that something 
like
this might work:

                 @Consumes(MediaType.APPLICATION_JSON)
 
                 @Produces(MediaType.APPLICATION_JSON)  
                 public BlahReturn getBlah(@QueryParam("getBlahInput") 
Set<String>
getBlahInput) { 
                 ...

I can't seem to be able to format the URL for the input correctly no 
matter
how I try. I always get a "HTTP Status 415" due to the request format. Any
ideas how to code a service like this and how to format the URL parameters
for the input as a JSON list?

Thanks in advance






--
View this message in context: 
http://apache-wink-users.3471013.n2.nabble.com/How-can-I-pass-parameters-of-type-java-util-Set-to-a-Wink-JAX-RS-service-tp7572641.html

Sent from the Apache Wink Users mailing list archive at Nabble.com.



Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU