• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Generalized Parsing for SOAP Response  RSS feed

Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi alll,

i am creating a web service client, i have used JAX-WS ,

i'm assigning the response to a result object, i have several methods on the web service, is there any way to create a generalized method which will parse the response object and get the response in delimited String, each method will have different response formats.

relevent XML Code:

it would be great if any one could give their suggestion how this can be handled.
Ranch Hand
Posts: 2198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I understand, you want to be able to handle the response from different kinds of SOAP requests in one and the same way.
This can be done if the contents of the SOAP body is always represented by a JAXB bean. To develop something like this:
- Create an XML schema describing all the different kinds of response objects that may be contained in the SOAP body.
- Use the JAXB schema compiler XJC to create corresponding JAXB bean classes.
- When the client receives the response, it extracts the contents of the SOAP body and then uses JAXB to transform the XML to a Java object tree.
JAXB will select the appropriate JAXB bean class, create an instance of it and populate its properties.
Hope this helps!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!