List of usage examples for javax.xml.soap Node getNodeType
public short getNodeType();
From source file:org.libreplan.importers.TimSoapClient.java
/** * Unmarshals the specified paramter <code>soapBody</code> to the specified * <code>clazz</code>//from ww w . ja va2 s. c om * * @param clazz * object to hold unmarashal result * @param soapBody * the soap body to be unmarshalled * @return the unmarashalled object * @throws JAXBException * if unmarshal failed */ @SuppressWarnings("unchecked") private static <T> T unmarshal(Class<T> clazz, SOAPBody soapBody) throws JAXBException { JAXBContext jaxbContext = JAXBContext.newInstance(clazz); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Node bindElement = (Node) soapBody.getFirstChild(); while (bindElement.getNodeType() != Node.ELEMENT_NODE) { bindElement = (Node) bindElement.getNextSibling(); } return unmarshaller.unmarshal(bindElement, clazz).getValue(); }