Description
Given the sample interface invoiceWebservice:
@Path("invoice/") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.APPLICATION_XML) public interface InvoiceWebservice { @POST public void insert(WSInvoice wsInvoice); [...] }
The usage of insert of this sample interface will cause an error, if used as both client and server interface.
The client will send the http header "Accept: text/plain" due to return type void of insert(WSInvoice). But the server will respond with http "406 not acceptable", because the method inherited @Produces(MediaType.APPLICATION_XML).
A workaround is to only annotate the methods, so insert does not get an @Produces annotation, or adding "text/plain" to @Consumes.