json - Efficient way of parsing Jax-ws Restful Response -


i need parse jax-ws rest response , tried following 2 ways of parsing response.both works good.but in need know best efficient way of implementation.please provide me view.

first approach:

  • use getentity object , response input stream.
  • using jackson objectmapper readvalue() -covert inputstream java object.
  • using getters , setters of nested java class response objects member values.

second approach:

  • use getentity object , response input stream , and convert input stream string.
  • using google json api,convert string json object.
  • using json parser , nested objects member values.

i first approach better 2 reasons:

  1. you don't go through intermediate process of reading response payload string
  2. the setter methods called during jackson deserialization may perform validation on input , throw appropriate exceptions, validation during deserialization.

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -