use of org.apache.cxf.frontend.ServerFactoryBean in project cxf by apache.
the class DocLitBareTest method testNamespaceCrash.
@Test
public void testNamespaceCrash() {
ServerFactoryBean svrFactory = new ServerFactoryBean();
svrFactory.setServiceClass(University.class);
svrFactory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
svrFactory.setAddress("local://dlbTest");
svrFactory.setServiceBean(new UniversityImpl());
svrFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
svrFactory.create();
ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
factory.getServiceFactory().setDataBinding(new AegisDatabinding());
factory.setServiceClass(University.class);
factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
factory.setAddress("local://dlbTest");
University client = (University) factory.create();
Teacher tr = client.getTeacher(new Course(40, "Intro to CS", "Introductory Comp Sci"));
assertNotNull(tr);
assertEquals(52, tr.getAge());
assertEquals("Mr. Tom", tr.getName());
}
use of org.apache.cxf.frontend.ServerFactoryBean in project cxf by apache.
the class FlatArrayTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
service = new FlatArrayService();
ServerFactoryBean sf = new ServerFactoryBean();
// use full parameter names.
sf.setServiceClass(FlatArrayServiceInterface.class);
sf.setServiceBean(service);
sf.setAddress("local://FlatArray");
sf.setDataBinding(new AegisDatabinding());
sf.create();
arrayWsdlDoc = getWSDLDocument("FlatArrayServiceInterface");
}
use of org.apache.cxf.frontend.ServerFactoryBean in project cxf by apache.
the class ClassTest method startServer.
@Before
public void startServer() throws Exception {
AegisContext context = new AegisContext();
context.initialize();
context.getTypeMapping().register(new ClassAsStringType());
ServerFactoryBean b = new ServerFactoryBean();
b.setDataBinding(new AegisDatabinding(context));
b.setServiceClass(GenericsService.class);
b.setAddress("local://GenericsService");
server = b.create();
}
use of org.apache.cxf.frontend.ServerFactoryBean in project cxf by apache.
the class ClientServiceConfigTest method before.
@Before
public void before() throws Exception {
super.setUp();
ReflectionServiceFactoryBean factory = new ReflectionServiceFactoryBean();
factory.setInvoker(new BeanInvoker(new EchoImpl()));
factory.setDataBinding(new AegisDatabinding());
ServerFactoryBean svrFac = new ServerFactoryBean();
svrFac.setAddress("local://Echo");
svrFac.setServiceFactory(factory);
svrFac.setServiceClass(Echo.class);
svrFac.setBus(getBus());
svrFac.create();
Endpoint endpoint = Endpoint.create(new EchoImpl());
impl = (EndpointImpl) endpoint;
impl.setDataBinding(new AegisDatabinding());
endpoint.publish("local://JaxWsEcho");
}
use of org.apache.cxf.frontend.ServerFactoryBean in project cxf by apache.
the class JaxWsWebServicePublisherBeanPostProcessor method createAndPublishEndpoint.
private void createAndPublishEndpoint(String url, Object implementor) {
ServerFactoryBean serverFactory = null;
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);
DataBinding dataBinding = null;
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();
}
Aggregations