I don't think you ever need ResponseReader with WebClient; Sergey put it
in 2.3.2 for client proxies only, and then added it to upcoming 2.3.3
for WebClient.
I *think* you want something like:
String jsonString =
client.accept("application/json").path("/definedPredicates").get(String.class);
Failing that, adding a custom MessageBodyReader as a Provider to handle
the InputStream -> JSON conversion. But Sergey would know more.
Glen
On 26.01.2011 22:05, Benson Margulies wrote:
Given the following, I expected the provider to produce the entity in
the response. Instead, I just get the stream. The doc mentions a
ResponseReader, but doesn't show use with WebClient. What's the
provider for, in any case, if a ResponseReader is needed?
List<Object> providers = new ArrayList<Object>();
providers.add(new
org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider());
WebClient client = WebClient.create(endpointAddress, providers);
Response r =
client.accept("application/json").path("/definedPredicates").get();
Object o = r.getEntity();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza