Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean


public class WSAFeatureTest extends AbstractCXFTest {
    static final String PORT = TestUtil.getPortNumber(WSAFeatureTest.class);
    @Test
    public void testServerFactory() {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.getFeatures().add(new WSAddressingFeature());
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost:" + PORT + "/test");
        sf.setStart(false);
        sf.setBus(getBus());
       
        Server server = sf.create();
       
        Endpoint endpoint = server.getEndpoint();
        checkAddressInterceptors(endpoint.getInInterceptors());       
       
    }
View Full Code Here


        protected void run() {
            SpringBusFactory bf = new SpringBusFactory();
            Bus bus = bf.createBus("org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/server.xml");

            JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean();
            serviceFactory.setBus(bus);
            serviceFactory.setServiceClass(MessageProviderWithAddressingPolicy.class);
            serviceFactory.setWsdlLocation("wsdl_systest_wsspec/addr-jaxwsmm.wsdl");
            serviceFactory.setAddress(ADDRESS);
            org.apache.cxf.endpoint.Server provider = serviceFactory.create();
            EndpointInfo ei = provider.getEndpoint().getEndpointInfo();
            LOG.info("Started server at: " + ei.getAddress());

            testInterceptors(bus);
        }
View Full Code Here

    @Test
    public void testServers() throws Exception {
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/servers.xml"});

        JaxWsServerFactoryBean bean;
        BindingConfiguration bc;
        SoapBindingConfiguration sbc;

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineSoapBindingRPC");
        assertNotNull(bean);

        bc = bean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        sbc = (SoapBindingConfiguration) bc;
        assertEquals("rpc", sbc.getStyle());

        bean = (JaxWsServerFactoryBean) ctx.getBean("simple");
        assertNotNull(bean);

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineWsdlLocation");
        assertNotNull(bean);
        assertEquals(bean.getWsdlLocation(), "wsdl/hello_world_doc_lit.wsdl");

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineSoapBinding");
        assertNotNull(bean);

        bc = bean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        sbc = (SoapBindingConfiguration) bc;
        assertTrue("Not soap version 1.2: " + sbc.getVersion(),  sbc.getVersion() instanceof Soap12);

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineDataBinding");
View Full Code Here

        assertEquals("two", holder.value);
    }
   
    @Test
    public void testServer() throws Exception {
        JaxWsServerFactoryBean svr = new JaxWsServerFactoryBean();
        svr.setBus(getBus());
        svr.setServiceBean(new HolderServiceImpl());
        svr.setAddress(address);
        svr.create();

        addNamespace("h", "http://holder.jaxws.cxf.apache.org/");
        Node response;

        response = invoke(address, LocalTransportFactory.TRANSPORT_ID, "echo.xml");
View Full Code Here

            sfb = new ServerFactoryBean();
            sfb.setDataBinding(new AegisDatabinding());
        }
        else if (CxfConstants.JAX_WS_FRONTEND.equals(frontend))
        {
            sfb = new JaxWsServerFactoryBean();
        }
        else
        {
            throw new CreateException(CxfMessages.invalidFrontend(frontend), this);
        }
View Full Code Here

        assertEquals("http://apache.org/hello_world_soap_http", service.getName().getNamespaceURI());

        InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
        assertNotNull(intf);

        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setBus(bus);
        svrFactory.setServiceFactory(bean);
        svrFactory.setStart(false);

        ServerImpl server = (ServerImpl)svrFactory.create();
        assertTrue(server.getEndpoint().getService().getInvoker() instanceof JAXWSMethodInvoker);

        Endpoint endpoint = server.getEndpoint();
        Binding binding = endpoint.getBinding();
        assertTrue(binding instanceof SoapBinding);
View Full Code Here

        assertEquals("DOMSourcePayloadProviderService", service.getName().getLocalPart());

        InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
        assertNotNull(intf);

        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setBus(getBus());
        svrFactory.setServiceFactory(bean);
        String address = "http://localhost:9000/test";
        svrFactory.setAddress(address);
        svrFactory.setTransportId(LocalTransportFactory.TRANSPORT_ID);

        ServerImpl server = (ServerImpl)svrFactory.create();

        assertEquals(1, service.getServiceInfos().get(0).getEndpoints().size());

        Endpoint endpoint = server.getEndpoint();
        Binding binding = endpoint.getBinding();
View Full Code Here

        InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
        assertNotNull(intf);
        assertEquals(1, intf.getOperations().size());

        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setBus(getBus());
        svrFactory.setServiceFactory(bean);
        String address = "local://localhost:9000/test";
        svrFactory.setAddress(address);

        ServerImpl server = (ServerImpl)svrFactory.create();

        // See if our endpoint was created correctly
        assertEquals(1, service.getServiceInfos().get(0).getEndpoints().size());

        Endpoint endpoint = server.getEndpoint();
View Full Code Here

        InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
        assertNotNull(intf);
        assertEquals(1, intf.getOperations().size());

        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setBus(getBus());
        svrFactory.setServiceFactory(bean);
        String address = "local://localhost:9000/test";
        svrFactory.setAddress(address);

        ServerImpl server = (ServerImpl)svrFactory.create();

        Endpoint endpoint = server.getEndpoint();
        Binding binding = endpoint.getBinding();
        assertTrue(binding instanceof SoapBinding);
View Full Code Here

        assertValid("/s:Envelope/s:Body/j:sayHi", res);
    }
   
    @Test
    public void testStreamSourceProviderCodeFirst() throws Exception {
        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setServiceClass(StreamSourcePayloadProvider.class);
        svrFactory.setBus(getBus());
        svrFactory.setServiceBean(new StreamSourcePayloadProvider());
        String address = "http://localhost:9000/test";
        svrFactory.setAddress(address);
        svrFactory.setTransportId(LocalTransportFactory.TRANSPORT_ID);

        svrFactory.create();

        Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID, "/org/apache/cxf/jaxws/sayHi.xml");
       
        addNamespace("j", "http://service.jaxws.cxf.apache.org/");
        assertValid("/s:Envelope/s:Body/j:sayHi", res);
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.