I need to parse the jax-ws rest response and I tried the following two ways of parsing the response.Both works good.But I am in need to know the best efficient way of implementation.Please provide me your view.
First Approach:
- Use getEntity Object and get the response as Input Stream.
- Using Jackson ObjectMapper readValue() -covert the inputstream to java object.
- Using getters and setters of nested java class get the response objects member values.
Second Approach:
- Use getEntity Object and get the response as Input Stream and and convert the Input Stream to String.
- Using Google Json API,convert the string to json object.
- Using Json parser and get the nested objects member values.