How to parse SOAP message into Jaxb classes

2019-02-28 03:38发布

问题:

I have a SOAPMessage Object. I would like to parse and convert it into a set of Jaxb classes. How would I convert the message into a format that Jaxb can unmarshal?

javax.xml.bind.Unmarshaller.unmarshal(??)

回答1:

The body of the SOAP message contains the actual data and its the bit you want to unmarshal. You could do the following:

Node node = soapMessage.getSOAPBody();
unmarshaller.unmarshal(node)(


标签: java soap jaxb