Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

JAX-RS client proxy and Jersey MessageBodyWriters

$
0
0
Hi.

I have a REST server API that uses Jersey for JAX-RS implementation
(2.0). To upload files to the REST service, I use their MultiPart type
within
a server API method due to a (yet) missing JAX-RS standardization.

Since Jersey doesn't offer a proxy-based client API (yet?), I want to
use the nice CXF client proxy. I've added the jersey multipart jar to
the client
classpath as well. But when I invoke the upload method with the
MultiPart parameter CXF complains about the missing MessageBodyWriter
handling
MultiPart. So that means, that CXF isn't picking up the provider
automatically, right? So I've learned, I can register the provider per
jaxrs:providers via
spring xml file and also via create method.

The problem is, that the Jersey MultiPart class expects a

https://docs.oracle.com/javaee/6/api/javax/ws/rs/ext/Providers.html

to be injected in the constructor. So registering the providers fails,
because CXF can't instantiate the class correctly.
So my questions is: is there a way to make CXF inject the Providers to
the constructor? And if not, is there a way
for me to get a reference to the Providers within the client so I can
try to instantiate the MultiPart provider by myself?

Thanks for your help!
Veit

Viewing all articles
Browse latest Browse all 5648

Trending Articles