Thanks Sergey. 

Is the WebClient thread-safe? I'm using a single instance of WebClient to 
service multiple requests. 
Do I need to call the reset method on the webclient between successive calls?

-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]] 
Sent: Monday, March 26, 2012 11:01 AM
To: [email protected]
Subject: Re: How to parse string from javax.ws.rs.core.Response?

Hi
On 26/03/12 16:49, Ganesan, Chandru wrote:
>
> Hi
>
> I'm using a simple rest client that executes a query and gets String 
> response. I'm using WebClient.get(...) to execute the REST call as follows.
>
> Response jsonResponse = oneViewWebClient.get();
>
> I do see the response code of 200 in the jsonResponse object but unable to 
> access the string value from the returned response. In this case, I'd like to 
> parse the response using jsonResponse.getEntity(..) I'm not using JAXB to 
> deserialize the object, since it's a string is there a simple method to parse 
> the response?
>

String str = oneViewWebClient.get(String.class);
should do it, you can also get the Response:
oneViewWebClient.getResponse()

Cheers, Sergey

> Thanks
> Chandru
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to