This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Can you explain the circumstances of your application more? All web service stacks already convert SOAP to java objects ... I'm not clear why you want to do it explicitly using JAXB.
Joined: May 11, 2010
I am trying to post an XML to a Rest Webservice. In the REST webservice, i am trying to manipulate the XML and posting it to the ISTM webserive which will create a ticket in BMC Remedy ITSM system. I will get the reponse back from the ITSM system with all the ticket details as specified in the query. As the response from ITSM is a SOAP message, it is difficuilt for the users to understand it. So I am trying to transform it to a XML.
I feel that since the ITSM web service is a SOAP style WS, the path of least maintenance is to use it as a SOAP style WS.
Its WSDL should be the one and only contract.
By trying to manipulate its SOAP representation, you'll introduce a rather fragile coupling to the SOAP binding instead of the WSDL.
If that service ever changes its SOAP bindings even slightly (which can happen if they change their WS stack), your code will need modifications.
Instead, I feel your REST webservice component should become a proper SOAP WS client to the ITSM webservice (the JAXWS implementation that comes with the JRE should make it a simple enough implementation. Prototype and try out.). Using JAXWS, you'll get back some POJOs from that web service. Then convert those POJOs' fields to your user friendly XML format, using XStream / JAXB / DOM,....