use of org.apache.cxf.aegis.databinding.AegisDatabinding 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.aegis.databinding.AegisDatabinding in project cxf by apache.
the class ProxyTest method testProxy.
@Test
public void testProxy() throws Exception {
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
proxyFac.setAddress("local://HelloProxyService");
proxyFac.setBus(getBus());
AegisContext aegisContext = new AegisContext();
aegisContext.getBeanImplementationMap().put(Hello.class, MyHello.class.getName());
AegisDatabinding binding = new AegisDatabinding();
binding.setAegisContext(aegisContext);
setupAegis(proxyFac.getClientFactoryBean(), binding);
HelloProxyService client = proxyFac.create(HelloProxyService.class);
Hello h = client.sayHiWithProxy();
assertTrue(h instanceof MyHello);
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.
the class DuplicateArrayTest method testServiceStart.
@Test
public void testServiceStart() throws Exception {
AegisDatabinding binder = new AegisDatabinding();
JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean();
serviceFactory.getServiceFactory().setDataBinding(binder);
TypeCreationOptions configuration = binder.getAegisContext().getTypeCreationOptions();
configuration.setDefaultMinOccurs(1);
configuration.setDefaultNillable(false);
binder.getAegisContext().setWriteXsiTypes(true);
serviceFactory.setAddress("local://DuplicateArrayService");
serviceFactory.setServiceBean(new DuplicateArrayServiceBean());
serviceFactory.setServiceClass(DuplicateArrayService.class);
Document doc = this.getWSDLDocument(serviceFactory.create());
this.assertValid("//wsdl:definitions/wsdl:types" + "/xsd:schema[@targetNamespace='http://cxf.apache.org/arrays']" + "/xsd:complexType[@name='ArrayOfAnyType']", doc.getDocumentElement());
}
use of org.apache.cxf.aegis.databinding.AegisDatabinding 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.aegis.databinding.AegisDatabinding in project cxf by apache.
the class FlatArrayTest method testFlatCollection.
@Test
public void testFlatCollection() throws Exception {
ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
proxyFac.setDataBinding(new AegisDatabinding());
proxyFac.setAddress("local://FlatArray");
proxyFac.setBus(getBus());
FlatArrayServiceInterface client = proxyFac.create(FlatArrayServiceInterface.class);
BeanWithFlatCollection bwfc = new BeanWithFlatCollection();
bwfc.getValues().add(1);
bwfc.getValues().add(2);
bwfc.getValues().add(3);
bwfc = client.echoBeanWithFlatCollection(bwfc);
assertEquals(3, bwfc.getValues().size());
assertEquals(Integer.valueOf(1), bwfc.getValues().get(0));
assertEquals(Integer.valueOf(2), bwfc.getValues().get(1));
assertEquals(Integer.valueOf(3), bwfc.getValues().get(2));
}
Aggregations