use of whitebox.message.source.types.ValueType in project metro-jax-ws by eclipse-ee4j.
the class SourceMessageTester method testSOAP11MessageAsJAXB.
public void testSOAP11MessageAsJAXB() {
try {
Message msg = createPayloadSourceMessage();
HeaderList hl = msg.getHeaders();
JAXBContext ctxt = null;
Unmarshaller unmarshaller = null;
try {
ctxt = JAXBContext.newInstance("whitebox.message.source.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