use of org.apache.cxf.jaxws.JaxWsServerFactoryBean in project cxf by apache.
the class JaxWsWebServicePublisherBeanPostProcessor method createAndPublishEndpoint.
private void createAndPublishEndpoint(String url, Object implementor) {
final ServerFactoryBean serverFactory;
if (prototypeServerFactoryBeanName != null) {
if (!beanFactory.isPrototype(prototypeServerFactoryBeanName)) {
throw new IllegalArgumentException("prototypeServerFactoryBeanName must indicate a scope='prototype' bean");
}
serverFactory = beanFactory.getBean(prototypeServerFactoryBeanName, ServerFactoryBean.class);
customizedServerFactory = true;
} else {
serverFactory = new JaxWsServerFactoryBean();
}
serverFactory.setServiceBean(implementor);
serverFactory.setServiceClass(ClassHelper.getRealClass(implementor));
serverFactory.setAddress(url);
final DataBinding dataBinding;
if (prototypeDataBindingBeanName != null) {
if (!beanFactory.isPrototype(prototypeDataBindingBeanName)) {
throw new IllegalArgumentException("prototypeDataBindingBeanName must indicate a scope='prototype' bean");
}
customizedDataBinding = true;
dataBinding = beanFactory.getBean(prototypeDataBindingBeanName, DataBinding.class);
} else {
dataBinding = new JAXBDataBinding();
}
serverFactory.setDataBinding(dataBinding);
serverFactory.setBus(getServletBus());
serverFactory.create();
}
use of org.apache.cxf.jaxws.JaxWsServerFactoryBean in project cxf by apache.
the class HttpTestActivator method createTestServer.
private Server createTestServer(String url) {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(Greeter.class);
factory.setAddress(url);
factory.setServiceBean(new GreeterImpl());
return factory.create();
}
use of org.apache.cxf.jaxws.JaxWsServerFactoryBean in project cxf by apache.
the class JmsTestActivator method publishService.
private Server publishService(ConnectionFactory connectionFactory) {
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setServiceClass(Greeter.class);
factory.setAddress("jms:queue:greeter");
factory.setFeatures(Collections.singletonList(new ConnectionFactoryFeature(connectionFactory)));
factory.setServiceBean(new GreeterImpl());
return factory.create();
}
use of org.apache.cxf.jaxws.JaxWsServerFactoryBean in project cxf by apache.
the class AbstractAegisTest method createJaxwsService.
protected Server createJaxwsService(Class<?> serviceClass, Object serviceBean, String address, QName name) {
if (address == null) {
address = serviceClass.getSimpleName();
}
JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean();
sf.setDataBinding(new AegisDatabinding());
JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
serverFactoryBean.setServiceClass(serviceClass);
if (serviceBean != null) {
serverFactoryBean.setServiceBean(serviceBean);
}
serverFactoryBean.setAddress("local://" + address);
serverFactoryBean.setServiceFactory(sf);
if (name != null) {
serverFactoryBean.setEndpointName(name);
}
return serverFactoryBean.create();
}
use of org.apache.cxf.jaxws.JaxWsServerFactoryBean in project cxf by apache.
the class ExceptionTest method testJaxws.
@Test(expected = HelloException.class)
public void testJaxws() throws Exception {
JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
sfbean.setServiceClass(ExceptionService.class);
setupAegis(sfbean);
sfbean.setAddress("local://ExceptionService4");
Server server = sfbean.create();
Service service = server.getEndpoint().getService();
service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setAddress("local://ExceptionService4");
proxyFac.setBus(getBus());
setupAegis(proxyFac.getClientFactoryBean());
ExceptionService clientInterface = proxyFac.create(ExceptionService.class);
clientInterface.sayHiWithException();
}
Aggregations