Hi!
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!