Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean


    private static Server server;

    @Before
    public void setUp() throws Exception {
        super.setUp();
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(MapTest.class);
        sf.setServiceBean(new MapTestImpl());
        sf.setAddress("local://MapTest");
        setupAegis(sf);
        server = sf.create();
        //        server.getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
//        server.getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
        server.start();
       
        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
View Full Code Here


    @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();
    }
View Full Code Here

import org.junit.Test;

public class DualOutServiceTest extends AbstractAegisTest {
    @Test
    public void testWSDL() throws Exception {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(DualOutService.class);
        sf.setAddress("local://DualOutService");
        sf.setBus(getBus());
        setupAegis(sf);
        sf.create();

        Document wsdl = getWSDLDocument("DualOutService");
        assertNotNull(wsdl);
        addNamespace("xsd", SOAPConstants.XSD);
View Full Code Here

    @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());
    }
View Full Code Here

    }

    @Test(expected = HelloException.class)
    @Ignore("Not working yet due to namespace things")
    public void testJaxwsServerSimpleClient() throws Exception {
        JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
        sfbean.setServiceClass(ExceptionService.class);
        sfbean.setDataBinding(new AegisDatabinding());
        sfbean.setAddress("local://ExceptionServiceJaxWs1");
        Server server = sfbean.create();
        Service service = server.getEndpoint().getService();
        service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

        ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
        proxyFac.setAddress("local://ExceptionServiceJaxWs1");
View Full Code Here

        clientInterface.sayHiWithException();
    }

    @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");
View Full Code Here

        clientInterface.sayHiWithException();
    }

    @Test(expected = HelloException.class)
    public void testJaxws() throws Exception {
        JaxWsServerFactoryBean sfbean = new JaxWsServerFactoryBean();
        sfbean.setServiceClass(ExceptionService.class);
        setupAegis(sfbean);
        sfbean.setAddress("local://ExceptionService4");
        Server server = sfbean.create();
        Service service = server.getEndpoint().getService();
        service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://ExceptionService4");
View Full Code Here

        } else {
            throw new JSDOMProviderException(ILLEGAL_INVOKE_TYPE);
        }
       
        Bus bus = BusFactory.getThreadDefaultBus();
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setWsdlLocation(wsdlLoc);
        factory.setBindingId(binding);
        factory.setServiceName(new QName(tgtNmspc, svcNm));
        factory.setEndpointName(new QName(tgtNmspc, portNm));
        Endpoint ep = new EndpointImpl(bus, this, factory);
        ep.publish(addr);
    }
View Full Code Here

    private Echo echo;
    private Client client;

    @Before
    public void setUpService() throws Exception {
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceBean(new EchoImpl());
        factory.setAddress("local://Echo");
        factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
        Server server = factory.create();
        Service service = server.getEndpoint().getService();
       
        service.getInInterceptors().add(new SAAJInInterceptor());
        service.getInInterceptors().add(new LoggingInInterceptor());
        service.getOutInterceptors().add(new SAAJOutInterceptor());
View Full Code Here

            + PORT + "/SoapContext/GreeterPort";
        // enable the options of stack trace and the exception cause message
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("exceptionMessageCauseEnabled", "true");
        properties.put("faultStackTraceEnabled", "true");
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setAddress(address);
        factory.setServiceBean(implementor);
        factory.setProperties(properties);
        factory.create();
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.JaxWsServerFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.