use of org.apache.hello_world_xml_http.wrapped.XMLService in project cxf by apache.
the class DispatchHandlerInvocationTest method testInvokeWithDOMSourcPayloadModeXMLBinding.
@Test
public void testInvokeWithDOMSourcPayloadModeXMLBinding() throws Exception {
URL wsdl = getClass().getResource("/wsdl/addNumbers.wsdl");
assertNotNull(wsdl);
XMLService service = new XMLService();
assertNotNull(service);
Dispatch<DOMSource> disp = service.createDispatch(portNameXML, DOMSource.class, Mode.PAYLOAD);
setAddress(disp, addNumbersAddress);
TestHandlerXMLBinding handler = new TestHandlerXMLBinding();
addHandlersProgrammatically(disp, handler);
InputStream is = getClass().getResourceAsStream("/messages/XML_GreetMeDocLiteralReq.xml");
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage soapReq = factory.createMessage(null, is);
DOMSource domReqMessage = new DOMSource(soapReq.getSOAPPart());
DOMSource response = disp.invoke(domReqMessage);
assertNotNull(response);
}
Aggregations