We got a REST service implemtented in Apache CXF available for our client
exposed like this:
@POST
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.TEXT_PLAIN)
@Path("/process")
public Response processBean(Bean bean);
The Bean object is annotated with @XmlRootElement and all this works great. The
problem is that the client is not setting the right content-type header (should
be "application/xml" but client sets "application/x-form-urlencoded").
Apache CXF is not regonizing the method as a valid method for the (incorrect)
call since the content-type is wrong. If I change @Consumes to "*/*" Apache CXF
does not know how to parse the POST payload (no MessageBodyReader). The client
will eventually change the header but we need a quick fix for now.
Any ideas?
Regards,
Carljohan