Search in sources :

Example 1 with SOAPService

use of org.apache.intfault.SOAPService in project cxf by apache.

the class IntFaultClientServerTest method testBasicConnection.

@Test
public void testBasicConnection() throws Exception {
    URL wsdl = getClass().getResource("/wsdl/hello_world_fault.wsdl");
    assertNotNull("WSDL is null", wsdl);
    SOAPService service = new SOAPService(wsdl, serviceName);
    assertNotNull("Service is null", service);
    Greeter greeter = service.getSoapPort();
    ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
    ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor());
    updateAddressPort(greeter, PORT);
    try {
        greeter.testDocLitFault("fault");
    } catch (BadRecordLitFault e) {
        assertEquals(5, e.getFaultInfo());
        assertSoapHeader((BindingProvider) greeter);
    }
}
Also used : SOAPService(org.apache.intfault.SOAPService) BadRecordLitFault(org.apache.intfault.BadRecordLitFault) LoggingOutInterceptor(org.apache.cxf.ext.logging.LoggingOutInterceptor) Greeter(org.apache.intfault.Greeter) LoggingInInterceptor(org.apache.cxf.ext.logging.LoggingInInterceptor) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 BindingProvider (javax.xml.ws.BindingProvider)1 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)1 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)1 BadRecordLitFault (org.apache.intfault.BadRecordLitFault)1 Greeter (org.apache.intfault.Greeter)1 SOAPService (org.apache.intfault.SOAPService)1 Test (org.junit.Test)1