users@jersey.java.net

Getting problem while using _at_Consumes( { MediaType.APPLICATION_XML })

From: Vikas Sukhwani <v.sukhwani_at_gmail.com>
Date: Tue, 10 Aug 2010 20:40:15 +0530

Hi,

I am trying to create a web service using JAX-RS but i am not able to hit
the Resource when i am using @Consumes( { MediaType.APPLICATION_XML }).

I am trying to get the xml request Unmarshalled using JAXB and getting the
unmarshalled object directly at my method.

@POST
    @Produces( { MediaType.APPLICATION_XML })
    @Consumes( { MediaType.APPLICATION_XML })
    @Path(value = CONTRACT_URL)
    public Response publishContract(@PathParam(VERSION) final String
version, final JAXBElement<Contracts> contractsRequest) throws Exception {

But the request is not at all reaching to my resource (Application layer).

I tried to debug but the request is not reaching context resolver also.

I am stuck at this point for a long time and not able to move further.

Can you please help me with this issue

Please find the code snippets attached:

Any help will be appreciated.

Thanks,
Vikas