Search in sources :

Example 1 with SayHi

use of org.apache.hello_world_soap_http.types.SayHi in project cxf by apache.

the class DispatchTest method testJAXB.

@Test
public void testJAXB() throws Exception {
    d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/sayHiResponse.xml"));
    URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
    assertNotNull(wsdl);
    SOAPService service = new SOAPService(wsdl, SERVICE_NAME);
    assertNotNull(service);
    JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
    Dispatch<Object> disp = service.createDispatch(PORT_NAME, jc, Service.Mode.PAYLOAD);
    SayHi s = new SayHi();
    Object response = disp.invoke(s);
    assertNotNull(response);
    assertTrue(response instanceof SayHiResponse);
}
Also used : SOAPService(org.apache.hello_world_soap_http.SOAPService) SayHi(org.apache.hello_world_soap_http.types.SayHi) SayHiResponse(org.apache.hello_world_soap_http.types.SayHiResponse) JAXBContext(javax.xml.bind.JAXBContext) MessageReplayObserver(org.apache.cxf.jaxws.MessageReplayObserver) URL(java.net.URL) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Aggregations

URL (java.net.URL)1 JAXBContext (javax.xml.bind.JAXBContext)1 AbstractJaxWsTest (org.apache.cxf.jaxws.AbstractJaxWsTest)1 MessageReplayObserver (org.apache.cxf.jaxws.MessageReplayObserver)1 SOAPService (org.apache.hello_world_soap_http.SOAPService)1 SayHi (org.apache.hello_world_soap_http.types.SayHi)1 SayHiResponse (org.apache.hello_world_soap_http.types.SayHiResponse)1 Test (org.junit.Test)1