Search in sources :

Example 31 with AegisDatabinding

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);
}
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)

Example 32 with AegisDatabinding

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);
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) ReflectionServiceFactoryBean(org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Example 33 with AegisDatabinding

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);
}
Also used : JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) NoDefaultConstructorBeanTypeRegistrar(org.apache.cxf.aegis.custom.types.NoDefaultConstructorBeanTypeRegistrar) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) NoDefaultConstructorBeanKeyTypeRegistrar(org.apache.cxf.aegis.custom.types.NoDefaultConstructorBeanKeyTypeRegistrar) Test(org.junit.Test)

Example 34 with AegisDatabinding

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();
}
Also used : Server(org.apache.cxf.endpoint.Server) BeanInvoker(org.apache.cxf.service.invoker.BeanInvoker) JaxWsProxyFactoryBean(org.apache.cxf.jaxws.JaxWsProxyFactoryBean) Service(org.apache.cxf.service.Service) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Test(org.junit.Test) AbstractAegisTest(org.apache.cxf.aegis.AbstractAegisTest)

Example 35 with AegisDatabinding

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()));
}
Also used : WS1Impl(org.apache.cxf.aegis.inheritance.ws1.impl.WS1Impl) WS1(org.apache.cxf.aegis.inheritance.ws1.WS1) Server(org.apache.cxf.endpoint.Server) SimpleBean(org.apache.cxf.aegis.services.SimpleBean) ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) BeanInvoker(org.apache.cxf.service.invoker.BeanInvoker) AegisContext(org.apache.cxf.aegis.AegisContext) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) WS1ExtendedException(org.apache.cxf.aegis.inheritance.ws1.WS1ExtendedException) HashSet(java.util.HashSet)

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