I have a requirement that I need to send an xml from the restclient addon of firefox browser to the resource by adding that xml in the request body. For that I have written a message body reader implementation class and there I am converting that xml to java object. But I am not able to invoke that message body reader class. how to invoke that?
Share
You don’t invoke a MessageBodyReader. You mark it as a @Provider and ensure it’s added to your JAX-RS application’s classes or singletons. There are many ways to do that, some of which are dependent on which JAX-RS implementation you’re using. The MessageBodyReader is invoked by the JAX-RS implementation when needed to convert an HTTP entity to a POJO based on media type.