use of org.apache.hello_world_xml_http.wrapped.types.GreetMeResponse in project cxf by apache.
the class DispatchXMLClientServerTest method testJAXBMESSAGE.
@Test
public void testJAXBMESSAGE() throws Exception {
Service service = Service.create(SERVICE_NAME);
assertNotNull(service);
service.addPort(PORT_NAME, "http://cxf.apache.org/bindings/xformat", "http://localhost:" + port + "/XMLService/XMLDispatchPort");
GreetMe gm = new GreetMe();
gm.setRequestType("CXF");
JAXBContext ctx = JAXBContext.newInstance(ObjectFactory.class);
Dispatch<Object> disp = service.createDispatch(PORT_NAME, ctx, Service.Mode.MESSAGE);
GreetMeResponse resp = (GreetMeResponse) disp.invoke(gm);
assertNotNull(resp);
assertEquals("Hello CXF", resp.getResponseType());
try {
disp.invoke(null);
fail("Should have thrown a fault");
} catch (WebServiceException ex) {
// expected
}
}
Aggregations