Search in sources :

Example 6 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding 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();
}
Also used : AegisContext(org.apache.cxf.aegis.AegisContext) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) Before(org.junit.Before)

Example 7 with AegisDatabinding

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

the class CollectionTestsWithService method before.

@Before
public void before() {
    impl = new CollectionService();
    createService(CollectionServiceInterface.class, impl, null);
    ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
    proxyFac.getServiceFactory().getServiceConfigurations().add(0, new XFireCompatibilityServiceConfiguration());
    proxyFac.setDataBinding(new AegisDatabinding());
    proxyFac.setAddress("local://CollectionServiceInterface");
    proxyFac.setBus(getBus());
    csi = proxyFac.create(CollectionServiceInterface.class);
}
Also used : ClientProxyFactoryBean(org.apache.cxf.frontend.ClientProxyFactoryBean) XFireCompatibilityServiceConfiguration(org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) Before(org.junit.Before)

Example 8 with AegisDatabinding

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

the class AbstractAegisTest method createJaxwsService.

protected Server createJaxwsService(Class<?> serviceClass, Object serviceBean, String address, QName name) {
    if (address == null) {
        address = serviceClass.getSimpleName();
    }
    JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean();
    sf.setDataBinding(new AegisDatabinding());
    JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
    serverFactoryBean.setServiceClass(serviceClass);
    if (serviceBean != null) {
        serverFactoryBean.setServiceBean(serviceBean);
    }
    serverFactoryBean.setAddress("local://" + address);
    serverFactoryBean.setServiceFactory(sf);
    if (name != null) {
        serverFactoryBean.setEndpointName(name);
    }
    return serverFactoryBean.create();
}
Also used : JaxWsServiceFactoryBean(org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean)

Example 9 with AegisDatabinding

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

the class AbstractAegisTest method setupAegis.

protected void setupAegis(AbstractWSDLBasedEndpointFactory sf, AegisDatabinding binding) {
    if (binding == null) {
        AegisContext context = new AegisContext();
        if (enableJDOM) {
            context.setEnableJDOMMappings(true);
        }
        binding = new AegisDatabinding();
        // perhaps the data binding needs to do this for itself?
        binding.setBus(BusFactory.getDefaultBus());
        if (enableJDOM) {
            // this preserves pre-2.1 behavior.
            binding.setAegisContext(context);
        }
    }
    sf.getServiceFactory().getServiceConfigurations().add(0, new XFireCompatibilityServiceConfiguration());
    sf.getServiceFactory().setDataBinding(binding);
}
Also used : AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) XFireCompatibilityServiceConfiguration(org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration)

Example 10 with AegisDatabinding

use of org.apache.cxf.aegis.databinding.AegisDatabinding 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");
}
Also used : Endpoint(javax.xml.ws.Endpoint) BeanInvoker(org.apache.cxf.service.invoker.BeanInvoker) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) AegisDatabinding(org.apache.cxf.aegis.databinding.AegisDatabinding) ReflectionServiceFactoryBean(org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean) Before(org.junit.Before)

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