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

Upload file with CXF client proxy

$
0
0
Hi,
I'm trying to use CXF client proxies to connect to 3rd party REST Services using typed interfaces. Among other things I need to upload a file with a POST request to an URL. Using apache-httpclient the call to the service looks like this and works:

I tried to use the following interface to create a CXF client proxy to execute the call via cxf:

Instead of using File I already tried to use InputStream or byte[] but all the requests result in a 400 response (BadRequest) from the server. As the server is a 3rd party tool I have no more information about how the file is to be uploaded other than that the file needs to be the request body.

I turned on the logging interceptors and the request looks fine:

But the response is

Thus my question is: How can I do the call that works using httpclient with cxf?

Best regards

Viewing all articles
Browse latest Browse all 5648

Trending Articles