cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Dolan (Updated) (JIRA)" <>
Subject [jira] [Updated] (CXF-4067) JAX-RS WebClient proxy sometimes fails to set Content-Type from @Consumes
Date Fri, 27 Jan 2012 03:31:43 GMT


Chris Dolan updated CXF-4067:


A sample failing test case that shows the problem.
> JAX-RS WebClient proxy sometimes fails to set Content-Type from @Consumes
> -------------------------------------------------------------------------
>                 Key: CXF-4067
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.5
>         Environment: Talend Service Factory (Karaf 2.2.4, CXF 2.5.0)
>            Reporter: Chris Dolan
>         Attachments:
> I have a JAX-RS interface called JobQueueEndpoint with a method like this:
>     @POST
>     @Path("job/{queue}")
>     @Consumes(MediaType.TEXT_XML)
>     @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
>     JobIdentifierDTO submitJob(@PathParam("queue") String queueName, String jobXml);
> I create a client for this API like so:
>         JobQueueEndpoint resource = JAXRSClientFactory.create(jobQueueUrl, JobQueueEndpoint.class);
> and invoke:
>         resource.submitJob("qFoo", "<job/>");
> But I get this:
> Jan 26, 2012 8:09:23 PM org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
> WARNING: No operation matching request path "/jobqueue/job/qFoo" is found, Relative Path:
/job/qFoo, HTTP Method: POST, ContentType: text/plain, Accept: text/xml,application/json,.
Please enable FINE/TRACE log level for more details.
> The problem is that the client is sending "text/plain" and the server is expecting "text/xml".
I'm guessing that's because the jobXml argument is a String. It seems to me that the client
should always use the @Consumes value unless explicitly told otherwise. Perhaps the method
should be refactored to take a Document instead of a String, but this problem seems like a
> The other methods of this client work fine, so I believe it's not an environmental problem.
I've tried to trace the code of WebClient, but I've gotten lost in its complexity...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message