Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.ServerImpl


        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();
        assertTrue(binding instanceof XMLBinding);
       
        Node res = invoke(address, LocalTransportFactory.TRANSPORT_ID,
                          "/org/apache/cxf/jaxws/provider/sayHi.xml");
View Full Code Here


        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();
        Binding binding = endpoint.getBinding();
        assertTrue(binding instanceof SoapBinding);

        SoapBindingInfo sb = (SoapBindingInfo)endpoint.getEndpointInfo().getBinding();
        assertEquals("document", sb.getStyle());
View Full Code Here

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

        SoapBindingInfo sb = (SoapBindingInfo)endpoint.getEndpointInfo().getBinding();
        assertEquals("document", sb.getStyle());
View Full Code Here

                serviceFactory.create();
                updateClassResourceProviders();
            }
           
            Endpoint ep = createEndpoint();
            server = new ServerImpl(getBus(),
                                    ep,
                                    getDestinationFactory(),
                                    getBindingFactory());

            Invoker invoker = serviceFactory.getInvoker();
View Full Code Here

                serviceFactory.create();
                updateClassResourceProviders();
            }
           
            Endpoint ep = createEndpoint();
            server = new ServerImpl(getBus(),
                                    ep,
                                    getDestinationFactory(),
                                    getBindingFactory());

            Invoker invoker = serviceFactory.getInvoker();
View Full Code Here

     */
    protected void doPublish(String addr) {
        checkPublishPermission();
        checkPublishable();
       
        ServerImpl serv = null;
       
        ClassLoaderHolder loader = null;
        try {
            if (bus != null) {
                ClassLoader newLoader = bus.getExtension(ClassLoader.class);
                if (newLoader != null) {
                    loader = ClassLoaderUtils.setThreadContextClassloader(newLoader);
                }
            }
            serv = getServer(addr);
            if (addr != null) {           
                EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
                if (!endpointInfo.getAddress().contains(addr)) {
                    endpointInfo.setAddress(addr);
                }
                if (publishedEndpointUrl != null) {
                    // TODO is there a good place to put this key-string as a constant?
                    endpointInfo.setProperty("publishedEndpointUrl", publishedEndpointUrl);
                }

                if (null != properties) {
                    for (Entry<String, Object> entry : properties.entrySet()) {
                        endpointInfo.setProperty(entry.getKey(), entry.getValue());
                    }
                }

                this.address = endpointInfo.getAddress();
            }
            serv.start();
            publishable = false;
        } catch (Exception ex) {
            try {
                stop();
            } catch (Exception e) {
View Full Code Here

       
        Map<String, Object> props = new HashMap<String, Object>();
        props.put("contextMatchStrategy", "stem");
        sf.setProperties(props);
       
        ServerImpl svr = (ServerImpl) sf.create();

        svr.getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
       
        ClientImpl client = new ClientImpl(getBus(), svr.getEndpoint());
       
        Object[] objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomers"),
                                         new GetCustomers());
        assertNotNull(objects);
       
        Customers c = (Customers) objects[0];
        Customer customer = c.getCustomer().iterator().next();
        assertEquals("Dan Diephouse", customer.getName());
       
        GetCustomer getCustomer = new GetCustomer();
        getCustomer.setId(customer.getId());
        objects = client.invoke(new QName("http://cxf.apache.org/jra", "getCustomer"), getCustomer);
       
        customer = (Customer) objects[0];
        assertEquals("Dan Diephouse", customer.getName());
//       
//        objects = client.invoke(new QName("http://cxf.apache.org/jra", "deleteCustomer"),
//        customer.getId());
//        assertTrue(objects == null || objects.length == 0);
//       
        svr.destroy();
    }
View Full Code Here

                serviceFactory.create();
                updateClassResourceProviders();
            }
           
            Endpoint ep = createEndpoint();
            server = new ServerImpl(getBus(),
                                    ep,
                                    getDestinationFactory(),
                                    getBindingFactory());

            Invoker invoker = serviceFactory.getInvoker();
View Full Code Here

     */
    protected void doPublish(String addr) {
        checkPublishPermission();
        checkPublishable();
       
        ServerImpl serv = null;
       
        try {
            serv = getServer(addr);
            if (addr != null) {           
                EndpointInfo endpointInfo = serv.getEndpoint().getEndpointInfo();
                if (!endpointInfo.getAddress().contains(addr)) {
                    endpointInfo.setAddress(addr);
                }
                if (publishedEndpointUrl != null) {
                    // TODO is there a good place to put this key-string as a constant?
                    endpointInfo.setProperty("publishedEndpointUrl", publishedEndpointUrl);
                }
                this.address = endpointInfo.getAddress();
            }
            serv.start();
            publishable = false;
        } catch (Exception ex) {
            try {
                stop();
            } catch (Exception e) {
View Full Code Here

                    getBus().getOutInterceptors());
            cxfService.getOutFaultInterceptors().addAll(
                    getBus().getOutFaultInterceptors());

            chain = new JbiChainInitiationObserver(ep, getBus());
            server = new ServerImpl(getBus(), ep, null, chain);
            super.validate();
        } catch (DeploymentException e) {
            throw e;
        } catch (Exception e) {
            throw new DeploymentException(e);
View Full Code Here

TOP

Related Classes of org.apache.cxf.endpoint.ServerImpl

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.