public Object unmarshalRootElement ( Node node , BaseXmlTrxMessageIn soapTrxMessage ) throws Exception { // Override this! (If you can!) TransformerFactory tFact = TransformerFactory . newInstance ( ) ; Source source = new DOMSource ( node ) ; Writer writer = new StringWriter ( ) ; Result result = new StreamResult ( writer ) ; Transformer transformer = tFact . newTransformer ( ) ; transformer . transform ( source , result ) ; writer . flush ( ) ; writer . close ( ) ; String strXMLBody = writer . toString ( ) ; Reader inStream = new StringReader ( strXMLBody ) ; Object msg = this . unmarshalRootElement ( inStream , soapTrxMessage ) ; inStream . close ( ) ; return msg ; }
Create the root element for this message . You SHOULD override this if the unmarshaller has a native method to unmarshall a dom node .