Question

I'm using Jersey-client to .post() to a URL, CXF is on the otherside.

The client code is simply this...

WebResource resource = client.resource(HOST + ":" + port() + APPLICATION + service);
Object response = resource.post(responseTypeClass, request);

Now with CXF 2.7.0 if the 'request' object was null, it was ok, the service on the other side didn't need a payload, and it was fine.

With CXF 2.7.7 if the 'request' object is null, then I get a InvocationTargetException caused by "com.sun.jersey.api.client.UniformInterfaceException: Client response status: 415"

415: is a unsupported media type.

So I presume since it has no payload, it can't determine the media type of it and errors.

I'm stuck on how to fix this. I could just post an empty xml body, but it would be nice if there was a better approach.

Any ideas?

Thanks Jeff

Was it helpful?

Solution

I've just posted an empty body. Its not a real solution, but it does let me proceed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top