I am trying to implement GET method in Resteasy. I couldn't use QueryParam because there are many search parameters including a complex type. So I thought of using XML. In the code below, both request and response are JAXB classes generated from schema. My question is how the client can pass the request xml?
@GET
@Path("search")
@Produces(MediaType.APPLICATION_XML)
@Consumes(MediaType.APPLICATION_XML)
public SearchResponse searchTasks(SearchRequest searchReq)
{
Here's a sample client I created with Jersey. When I make a call, I am getting "415 Unsupported Media Type". Am I passing the XML right? Is it possible to send XML parameter to GET method?
webResource.accept(MediaType.APPLICATION_XML);
webResource.type(MediaType.APPLICATION_XML);
webResource.entity(req,MediaType.APPLICATION_XML);
SearchResponse return1 = webResource.get(SearchResponse.class);
I am deploying this in Tomcat.
Thanks for looking into this.