Search in sources :

Example 1 with HelloImpl

use of org.apache.hello_world_soap_http.HelloImpl in project cxf by apache.

the class EndpointImplTest method testWSAnnoWithoutWSDLLocationInSEI.

@Test
public void testWSAnnoWithoutWSDLLocationInSEI() throws Exception {
    HelloImpl hello = new HelloImpl();
    JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
    serviceFactory.setBus(getBus());
    serviceFactory.setInvoker(new BeanInvoker(hello));
    serviceFactory.setServiceClass(HelloImpl.class);
    try (EndpointImpl endpoint = new EndpointImpl(getBus(), hello, new JaxWsServerFactoryBean(serviceFactory))) {
        try {
            String address = "http://localhost:8080/test";
            endpoint.publish(address);
        } catch (IllegalArgumentException ex) {
            assertTrue(ex.getCause() instanceof BusException);
            assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException) ex.getCause()).getCode());
        }
    }
}
Also used : HelloImpl(org.apache.hello_world_soap_http.HelloImpl) JaxWsServiceFactoryBean(org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean) BeanInvoker(org.apache.cxf.service.invoker.BeanInvoker) BusException(org.apache.cxf.BusException) Test(org.junit.Test)

Aggregations

BusException (org.apache.cxf.BusException)1 JaxWsServiceFactoryBean (org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean)1 BeanInvoker (org.apache.cxf.service.invoker.BeanInvoker)1 HelloImpl (org.apache.hello_world_soap_http.HelloImpl)1 Test (org.junit.Test)1