use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class FlatArrayTest method testDataMovementPart.
@Test
public void testDataMovementPart() throws Exception {
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
proxyFac.setDataBinding(new AegisDatabinding());
proxyFac.setAddress("local://FlatArray");
proxyFac.setBus(getBus());
FlatArrayServiceInterface client = proxyFac.create(FlatArrayServiceInterface.class);
client.submitStringArray(STRING_ARRAY);
assertArrayEquals(STRING_ARRAY, service.stringArrayValue);
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class ClientServiceConfigTest method ordinaryParamNameTest.
@Test
public void ordinaryParamNameTest() throws Exception {
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
ReflectionServiceFactoryBean factory = new ReflectionServiceFactoryBean();
proxyFac.setServiceFactory(factory);
proxyFac.setDataBinding(new AegisDatabinding());
proxyFac.setAddress("local://Echo");
proxyFac.setBus(getBus());
Echo echo = proxyFac.create(Echo.class);
String boing = echo.simpleEcho("reflection");
assertEquals("reflection", boing);
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class CustomBeansTest method testClientSetup.
// CXF-2093 reports an explosion with this case.
@Test
public void testClientSetup() throws Exception {
JaxWsProxyFactoryBean clientFactory = new JaxWsProxyFactoryBean();
clientFactory.setAddress("local:not-really");
clientFactory.setServiceClass(Service.class);
AegisDatabinding dataBinding = new AegisDatabinding();
NoDefaultConstructorBeanTypeRegistrar beanRegistrar = new NoDefaultConstructorBeanTypeRegistrar();
beanRegistrar.setDataBinding(dataBinding);
beanRegistrar.register();
NoDefaultConstructorBeanKeyTypeRegistrar beanKeyRegistrar = new NoDefaultConstructorBeanKeyTypeRegistrar();
beanKeyRegistrar.setDataBinding(dataBinding);
beanKeyRegistrar.register();
clientFactory.setDataBinding(dataBinding);
clientFactory.create();
String uri = dataBinding.getAegisContext().getTypeMapping().getMappingIdentifierURI();
assertNotSame(DefaultTypeMapping.DEFAULT_MAPPING_URI, uri);
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class ExceptionTest method testJaxwsNoXfireCompat.
@Test(expected = HelloException.class)
public void testJaxwsNoXfireCompat() throws Exception {
JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
sfbean.setServiceClass(ExceptionService.class);
sfbean.setDataBinding(new AegisDatabinding());
sfbean.getServiceFactory().setDataBinding(sfbean.getDataBinding());
sfbean.setAddress("local://ExceptionServiceJaxWs");
Server server = sfbean.create();
Service service = server.getEndpoint().getService();
service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));
JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
proxyFac.setAddress("local://ExceptionServiceJaxWs");
proxyFac.setServiceClass(ExceptionService.class);
proxyFac.setBus(getBus());
proxyFac.getClientFactoryBean().getServiceFactory().setDataBinding(new AegisDatabinding());
ExceptionService clientInterface = (ExceptionService) proxyFac.create();
clientInterface.sayHiWithException();
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class ExceptionInheritanceTest method setUp.
public void setUp() throws Exception {
super.setUp();
AegisContext globalContext = new AegisContext();
globalContext.setWriteXsiTypes(true);
Set<String> l = new HashSet<>();
l.add(SimpleBean.class.getName());
l.add(WS1ExtendedException.class.getName());
globalContext.setRootClassNames(l);
AegisDatabinding binding = new AegisDatabinding();
binding.setAegisContext(globalContext);
ClientProxyFactoryBean pf = new ClientProxyFactoryBean();
setupAegis(pf.getClientFactoryBean(), binding);
pf.getServiceFactory().setProperties(props);
pf.setAddress("local://WS1");
pf.setProperties(props);
client = pf.create(WS1.class);
Server server = createService(WS1.class, new WS1Impl(), "WS1", binding);
server.getEndpoint().getService().setInvoker(new BeanInvoker(new WS1Impl()));
}
Aggregations