users@glassfish.java.net

POST Request With Multiple params

From: <forums_at_java.net>
Date: Wed, 21 Dec 2011 08:20:06 -0600 (CST)

 Hi guys,

I am trying to build a REST service which accepts a number of parameters and
an order object.
the parameters would be like: user_id,user_key,action etc.
And the object itself.
I've managed to write a method which accepts the object just by itself and
then is returned in xml. It also has the @XmlRootElement added to it.
I've also tried the using MultiplevaluedMap<String,String>:

@Path("add")
@Produces(MediaType.APPLICATION_XML)
@Consumes(MediaType.APPLICATION_XML)
public String createOrder(MultiplevaluedMap<String,String> formParams,DG
object){
return dg.toString();
}
 

I get and exception thrown:
The registered message body readers compatible with the MIME media type are:

My question is: How can I accept multiple params and an object through a POST
request, or is it even possible?

 

Thanks


--
[Message sent by forum member 'DMan']
View Post: http://forums.java.net/node/875966