> An example of ResponseReader (from the upcoming 

> Talend samples) is below:
> Again, though, this will unfortunately  need to wait until CXF 2.3.2 is  out.
> 
> HTH,
> Glen

Thank you very much for the book suggestion and the ResponseReader example. 
While I do understand the example, I'm having some difficulties getting it to 
work, specifically, I'm continually getting the exception: 


Cannot cast object  
'sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@181305e'  with 
class 'sun.net.www.protocol.http.HttpURLConnection$HttpInputStream'  to class 
'com.webprofiler.ws.dto.ProfileDto' 


I have the cxf-bundle-minimal-2.3.2.jar in my classpath and the relative code 
is 
below; do you see anything wrong?

        ResponseReader reader = new ResponseReader();
        reader.setEntityClass(ProfileDto.class);
        WebClientcustWebClient = 
WebClient.create(webClient.getBaseURI().toString(), 
Collections.singletonList(reader));
        Response response = 
custWebClient.path("/search/profile").type("application/json").accept("application/json").post(criteria);

        if (response.getStatus() == 200 || response.getStatus() == 204) {
            ProfileDto results = (ProfileDto) response.getEntity();
            ....code to generate view...
        }

Thanks

-Dan



      

Reply via email to