use of whitebox.message.saaj.types.ValueType in project metro-jax-ws by eclipse-ee4j.
the class SAAJMessageTester method testSOAP11MessageAsJAXB.
public void testSOAP11MessageAsJAXB() {
try {
HeaderList hl = msg.getHeaders();
JAXBContext ctxt = null;
Unmarshaller unmarshaller = null;
try {
ctxt = JAXBContext.newInstance("whitebox.message.saaj.types");
unmarshaller = ctxt.createUnmarshaller();
} catch (JAXBException e) {
e.printStackTrace();
assertTrue(false);
}
int i = 0;
// validate the headers form unmarshalled jaxb bean
for (Header h : hl) {
assertTrue(validateHeader(h, unmarshaller, headers[i++], SOAPVersion.SOAP_11));
}
// validate body
assertTrue(msg.getPayloadLocalPart().equals("Body") && msg.getPayloadNamespaceURI().equals("urn:test:types"));
JAXBElement<ValueType> body = msg.readPayloadAsJAXB(unmarshaller);
assertTrue(body.getValue().getValue().equals("Its Body"));
} catch (JAXBException e) {
e.printStackTrace();
assertTrue(false);
}
}
Aggregations