Search in sources :

Example 11 with GreeterRPCLit

use of org.apache.hello_world_rpclit.GreeterRPCLit in project cxf by apache.

the class RespectBindingFeatureClientServerTest method testRespectBindingFeature.

@Test
public void testRespectBindingFeature() throws Exception {
    startServers("/wsdl_systest/cxf2006.wsdl");
    try {
        GreeterRPCLit greeter = service.getPort(portName, GreeterRPCLit.class, new RespectBindingFeature(true));
        updateAddressPort(greeter, PORT);
        greeter.greetMe("hello");
        fail("WebServiceException is expected");
    } catch (Exception ex) {
        assertTrue("WebServiceException is expected", ex instanceof javax.xml.ws.WebServiceException);
        assertTrue("RespectBindingFeature message is expected: " + ex.getMessage(), ex.getMessage().indexOf("extension with required=true attribute") > -1);
    }
}
Also used : GreeterRPCLit(org.apache.hello_world_rpclit.GreeterRPCLit) RespectBindingFeature(javax.xml.ws.RespectBindingFeature) Test(org.junit.Test)

Aggregations

GreeterRPCLit (org.apache.hello_world_rpclit.GreeterRPCLit)11 Test (org.junit.Test)9 RespectBindingFeature (javax.xml.ws.RespectBindingFeature)5 SOAPServiceRPCLit (org.apache.hello_world_rpclit.SOAPServiceRPCLit)5 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)4 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)4 URL (java.net.URL)3 UnmarshalException (javax.xml.bind.UnmarshalException)2 QName (javax.xml.namespace.QName)2 MyComplexStruct (org.apache.hello_world_rpclit.types.MyComplexStruct)2 File (java.io.File)1 Endpoint (javax.xml.ws.Endpoint)1 WebServiceException (javax.xml.ws.WebServiceException)1 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)1