Veit Guna
2015-01-26 12:10:58 UTC
Hi.
Is it expected behavior, that after a JAX-RS client proxy request has been made, accessing the response via converted WebClient returns null?
My code:
Client client = WebClient.client(clientProxy);
System.out.println("client response: " + client.getResponse());
WebClient webClient = WebClient.fromClient(client);
System.out.println("webclient response. " + webClient.getResponse());
Outputs:
client response: ***@20e14502
webclient response. null
I also encountered, that after an entity has been returned by the client proxy invocation, accessing the response stream via Client returns an empty stream.
Using:
InputStream inputStream = response.readEntity(InputStream.class);
I figured out, that enabling client response buffering does the trick in this case:
WebClient.getConfig(store).getResponseContext().put("buffer.proxy.response", "true");
But I'm wondering, if that is the right usage of the "user" client API. Since the constant belonging to that property key is private
in ClientProxyImpl (BUFFER_PROXY_RESPONSE).
I'm using CXF 3.0.4-SNAPSHOT.
Thanks.
Veit
Is it expected behavior, that after a JAX-RS client proxy request has been made, accessing the response via converted WebClient returns null?
My code:
Client client = WebClient.client(clientProxy);
System.out.println("client response: " + client.getResponse());
WebClient webClient = WebClient.fromClient(client);
System.out.println("webclient response. " + webClient.getResponse());
Outputs:
client response: ***@20e14502
webclient response. null
I also encountered, that after an entity has been returned by the client proxy invocation, accessing the response stream via Client returns an empty stream.
Using:
InputStream inputStream = response.readEntity(InputStream.class);
I figured out, that enabling client response buffering does the trick in this case:
WebClient.getConfig(store).getResponseContext().put("buffer.proxy.response", "true");
But I'm wondering, if that is the right usage of the "user" client API. Since the constant belonging to that property key is private
in ClientProxyImpl (BUFFER_PROXY_RESPONSE).
I'm using CXF 3.0.4-SNAPSHOT.
Thanks.
Veit