use of org.apache.hello_world_soap_http.GreeterImpl in project camel by apache.
the class CxfPayloadProviderRouterTest method startService.
@BeforeClass
public static void startService() {
implementor = new GreeterImpl();
String address = "http://localhost:" + CXFTestSupport.getPort1() + "/CxfPayLoadProviderRouterTest/SoapContext/SoapPort";
endpoint = Endpoint.publish(address, implementor);
}
use of org.apache.hello_world_soap_http.GreeterImpl in project camel by apache.
the class WSAddressingTest method setUp.
@Before
public void setUp() throws Exception {
template = context.createProducerTemplate();
JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean();
svrBean.setAddress(getServerAddress());
svrBean.setServiceClass(Greeter.class);
svrBean.setServiceBean(new GreeterImpl());
SpringBusFactory bf = new SpringBusFactory();
URL cxfConfig = null;
if (getCxfServerConfig() != null) {
cxfConfig = ClassLoaderUtils.getResource(getCxfServerConfig(), this.getClass());
}
svrBean.setBus(bf.createBus(cxfConfig));
serviceEndpoint = svrBean.create();
}
use of org.apache.hello_world_soap_http.GreeterImpl in project camel by apache.
the class CxfPayloadProviderRouterTest method startService.
@BeforeClass
public static void startService() {
implementor = new GreeterImpl();
String address = "http://localhost:" + getPort1() + "/CxfPayLoadProviderRouterTest/SoapContext/SoapPort";
endpoint = Endpoint.publish(address, implementor);
}
use of org.apache.hello_world_soap_http.GreeterImpl in project cxf by apache.
the class EndpointImplTest method testEndpointServiceConstructor.
@Test
public void testEndpointServiceConstructor() throws Exception {
GreeterImpl greeter = new GreeterImpl();
JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
serviceFactory.setBus(getBus());
serviceFactory.setInvoker(new BeanInvoker(greeter));
serviceFactory.setServiceClass(GreeterImpl.class);
try (EndpointImpl endpoint = new EndpointImpl(getBus(), greeter, new JaxWsServerFactoryBean(serviceFactory))) {
WebServiceContext ctx = greeter.getContext();
assertNull(ctx);
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());
}
ctx = greeter.getContext();
assertNotNull(ctx);
}
}
use of org.apache.hello_world_soap_http.GreeterImpl in project cxf by apache.
the class GreeterTest method testEndpoint.
@Test
public void testEndpoint() throws Exception {
ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(resource);
bean.setWsdlURL(resource.toString());
bean.setBus(bus);
bean.setServiceClass(GreeterImpl.class);
GreeterImpl greeter = new GreeterImpl();
BeanInvoker invoker = new BeanInvoker(greeter);
Service service = bean.create();
assertEquals("SOAPService", service.getName().getLocalPart());
assertEquals("http://apache.org/hello_world_soap_http", service.getName().getNamespaceURI());
ServerFactoryBean svr = new ServerFactoryBean();
svr.setBus(bus);
svr.setServiceFactory(bean);
svr.setInvoker(invoker);
svr.create();
Node response = invoke("http://localhost:9000/SoapContext/SoapPort", LocalTransportFactory.TRANSPORT_ID, "GreeterMessage.xml");
assertEquals(1, greeter.getInvocationCount());
assertNotNull(response);
addNamespace("h", "http://apache.org/hello_world_soap_http/types");
assertValid("/s:Envelope/s:Body", response);
assertValid("//h:sayHiResponse", response);
}
Aggregations