Search in sources :

Example 26 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.

the class AegisWSDLNSTest method setupForTest.

private void setupForTest(boolean specifyWsdl) throws Exception {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
    factory.setServiceClass(AegisJaxWsWsdlNs.class);
    if (specifyWsdl) {
        factory.setServiceName(new QName("http://v1_1_2.rtf2pdf.doc.ws.daisy.marbes.cz", "AegisJaxWsWsdlNsImplService"));
        factory.setWsdlLocation("http://localhost:" + PORT + "/aegisJaxWsWSDLNS?wsdl");
    }
    factory.getServiceFactory().setDataBinding(new AegisDatabinding());
    factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsWSDLNS");
    client = (AegisJaxWsWsdlNs) factory.create();
}
Also used : QName(javax.xml.namespace.QName) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding)

Example 27 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.

the class Server method startServer.

public static void startServer() throws Exception {
    HelloWorldImpl helloworldImpl = new HelloWorldImpl();
    ServerFactoryBean svrFactory = new ServerFactoryBean();
    svrFactory.setServiceClass(HelloWorld.class);
    svrFactory.setAddress("http://localhost:9000/Hello");
    svrFactory.setServiceBean(helloworldImpl);
    svrFactory.getServiceFactory().setDataBinding(new AegisDatabinding());
    svrFactory.create();
}
Also used : ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding)

Example 28 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.

the class OperationNSTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
    sf.setServiceClass(NotificationLogImpl.class);
    sf.setAddress("local://NotificationLogImpl");
    sf.getServiceFactory().setDataBinding(new AegisDatabinding());
    sf.create();
}
Also used : AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Before(org.junit.Before)

Example 29 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.

the class OverrideTypeTest method testOverrideBean.

@Test
public void testOverrideBean() throws Exception {
    AegisDatabinding aegisDatabinding = new AegisDatabinding();
    Set<String> types = new HashSet<>();
    types.add("org.apache.cxf.aegis.inheritance.Employee");
    aegisDatabinding.setOverrideTypes(types);
    DataReader<XMLStreamReader> dataReader = aegisDatabinding.createReader(XMLStreamReader.class);
    InputStream employeeBytes = testUtilities.getResourceAsStream("/org/apache/cxf/aegis/override/employee.xml");
    XMLInputFactory readerFactory = XMLInputFactory.newInstance();
    XMLStreamReader reader = readerFactory.createXMLStreamReader(employeeBytes);
    Object objectRead = dataReader.read(reader);
    assertNotNull(objectRead);
    assertTrue(objectRead instanceof Employee);
    Employee e = (Employee) objectRead;
    assertEquals("long", e.getDivision());
}
Also used : XMLStreamReader(javax.xml.stream.XMLStreamReader) Employee(org.apache.cxf.aegis.inheritance.Employee) InputStream(java.io.InputStream) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) XMLInputFactory(javax.xml.stream.XMLInputFactory) HashSet(java.util.HashSet) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Example 30 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding in project cxf by apache.

the class FlatArrayTest method testDataMovementBean.

@Test
public void testDataMovementBean() throws Exception {
    ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
    proxyFac.setDataBinding(new AegisDatabinding());
    proxyFac.setAddress("local://FlatArray");
    proxyFac.setBus(getBus());
    FlatArrayServiceInterface client = proxyFac.create(FlatArrayServiceInterface.class);
    BeanWithFlatArray bwfa = new BeanWithFlatArray();
    bwfa.setValues(INT_ARRAY);
    client.takeBeanWithFlatArray(bwfa);
    assertArrayEquals(INT_ARRAY, service.beanWithFlatArrayValue.getValues());
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Aggregations

AegisDatabinding (org.apache.cxf.aegis.databinding.AegisDatabinding)37 Test (org.junit.Test)21 JaxWsProxyFactoryBean (org.apache.cxf.jaxws.JaxWsProxyFactoryBean)14 ClientProxyFactoryBean (org.apache.cxf.frontend.ClientProxyFactoryBean)12 AbstractAegisTest (org.apache.cxf.aegis.AbstractAegisTest)10 LoggingInInterceptor (org.apache.cxf.ext.logging.LoggingInInterceptor)7 LoggingOutInterceptor (org.apache.cxf.ext.logging.LoggingOutInterceptor)7 Before (org.junit.Before)7 ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)6 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)5 AegisContext (org.apache.cxf.aegis.AegisContext)4 Server (org.apache.cxf.endpoint.Server)4 BeanInvoker (org.apache.cxf.service.invoker.BeanInvoker)4 HashSet (java.util.HashSet)3 ReflectionServiceFactoryBean (org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean)3 QName (javax.xml.namespace.QName)2 XFireCompatibilityServiceConfiguration (org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration)2 AuthService (org.apache.cxf.authservice.AuthService)2 Authenticate (org.apache.cxf.authservice.Authenticate)2 Service (org.apache.cxf.service.Service)2