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

python - RuntimeError: can't re-enter readline -

python - PyInstaller UAC not working in onefile mode -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -