I am using CXF with JacksonJsonProvider for my REST Services. I have a test method as follows
@POST
@Path("/book/{id}")
@Consumes({"application/json, multipart/form-data, application/x-www-urlencoded"})
@Produces({"application/json"})
public boolean setOwner(Book book) {
System.out.println(book.getName());
return true;
}
Now if I make a POST request with a raw JSON string as follows
{"Book":{"name":"Book name","publisher":"Book publisher"}}
The request is processed correctly as I use Content-Type as 'application/json' while making the request.
But since I am integrating with an external service, I recieve either multipart/form-data OR application/x-www-urlencoded for which there is nothing afaik in Jackson that can handle it. If someone can point me to the right direction that would be great.
I can manage multipart/form-data with Jettison (part of CXF) but I would like to use Jackson.