Hi

On Tue, Mar 22, 2011 at 2:18 PM, Glinski, Tomasz <
[email protected]> wrote:

> Hi,
> I am writing a client to the server (no changes on server possible), that
> sends responses with no message body, with response status 200. CXF throws
> than WebApplicationException, as it expects status 204 in such situation.
> Is there a way to change the status "on-the-fly", before the response is
> parsed? Tried with interceptors, with no success...
>
>
Where is this WebApplicationException originating from ? Is client trying to
read the response body and fails ?
Do you use WebClient like this :

client.get(Book.class) ?

when the concrete type, as opposed to Response as expected, the runtime
thinks that the response stream has to be read. Can you try using Response,
say,

Response response = client.get();

?

CXF 2.3.3 has a ResponseReader utility class for reading Response entities

But you can also change the status from the custom *in* interceptor, do
message.getExchange().put(Message.RESPONSE_CODE, 204);

Cheers, Sergey

Greets
> Tomasz
>
>

Reply via email to