Package org.apache.cxf.frontend

Examples of org.apache.cxf.frontend.ServerFactoryBean


   
    private JaxWsServerFactoryBean jfb;
   
    @Before
    public void setUp() {
        fb = new ServerFactoryBean();
        fb.setAddress("local://localhost");
        fb.setBus(getBus());
       
        jfb = new JaxWsServerFactoryBean();
        jfb.setAddress("local://localhost");
View Full Code Here


public class ServerFactoryTest extends AbstractSimpleFrontendTest {

    @Test
    public void testSetDF() throws Exception {
        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress("http://localhost/Hello");
        svrBean.setServiceClass(HelloService.class);
        svrBean.setServiceBean(new HelloServiceImpl());
        svrBean.setBus(getBus());
        svrBean.setDestinationFactory(new CustomDestinationFactory());

        ServerImpl server = (ServerImpl)svrBean.create();
        assertTrue(server.getDestination() instanceof CustomDestination);
    }
View Full Code Here

        }
    }
   
    @Test
    public void testCXF1758() throws Exception {
        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress("http://localhost/Generics");
        svrBean.setServiceBean(new TestServiceImpl<String>() { });
        svrBean.setBus(getBus());
        ServerImpl server = (ServerImpl)svrBean.create();
        //XMLUtils.printDOM(getWSDLDocument(server));
        assertValid("//xsd:schema/xsd:complexType[@name='open']/xsd:sequence/"
                    + "xsd:element[@type='xsd:string']",
                    getWSDLDocument(server));
    }
View Full Code Here

                    + "xsd:element[@type='xsd:string']",
                    getWSDLDocument(server));
    }
    @Test
    public void testJaxbExtraClass() throws Exception {
        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress("http://localhost/Hello");
        svrBean.setServiceClass(HelloServiceImpl.class);
        svrBean.setBus(getBus());

        Map<String, Object> props = svrBean.getProperties();
        if (props == null) {
            props = new HashMap<String, Object>();
        }
        props.put("jaxb.additionalContextClasses",
                  new Class[] {GreetMe.class, GreetMeOneWay.class});
        svrBean.setProperties(props);
        Server serv = svrBean.create();
        Class[] extraClass = ((JAXBDataBinding)serv.getEndpoint().getService()
                .getDataBinding()).getExtraClass();
        assertEquals(extraClass.length, 2);
        assertEquals(extraClass[0], GreetMe.class);
        assertEquals(extraClass[1], GreetMeOneWay.class);
View Full Code Here

        }
        return hasAnnotation(cls.getSuperclass(), annotation);
    }

    public static ServerFactoryBean getServerFactoryBean(Class<?> cls) throws CamelException {
        ServerFactoryBean serverFactory  = null;
        try {
            if (cls == null) {
                serverFactory = new ServerFactoryBean();
                serverFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());

            } else {
                boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
                serverFactory = isJSR181SEnabled ? new JaxWsServerFactoryBean()
                            : new ServerFactoryBean();
            }
            return serverFactory;
        } catch (Exception e) {
            throw new CamelException(e);
        }
View Full Code Here

    private String serviceEndpointURI = "cxf://" + SERVICE_ADDRESS + "?" + SERVICE_CLASS + "&wrappedStyle=false";
   
    @BeforeClass
    public static void startService() {      
        //start a service
        ServerFactoryBean svrBean = new ServerFactoryBean();
   
        svrBean.setAddress(SERVICE_ADDRESS);
        svrBean.setServiceClass(HelloService.class);
        svrBean.setServiceBean(new HelloServiceImpl());
        svrBean.getServiceFactory().setWrapped(false);
   
        server = svrBean.create();
        server.start();
    }
View Full Code Here

   

    @BeforeClass
    public static void startServer() throws Exception {       
        // start a simple front service
        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress(SIMPLE_SERVER_ADDRESS);
        svrBean.setServiceClass(HelloService.class);
        svrBean.setServiceBean(new HelloServiceImpl());
        svrBean.setBus(CXFBusFactory.getDefaultBus());
        svrBean.create();
    }
View Full Code Here

    protected ProducerTemplate template;

    @BeforeClass
    public static void startService() throws Exception {
        // start a simple front service
        ServerFactoryBean svrBean = new ServerFactoryBean();
        svrBean.setAddress(SIMPLE_SERVER_ADDRESS);
        svrBean.setServiceClass(HelloService.class);
        svrBean.setServiceBean(new HelloServiceImpl());
        svrBean.setBus(CXFBusFactory.getDefaultBus());
        svrBean.create();
       
        GreeterImpl greeterImpl = new GreeterImpl();
        Endpoint.publish(JAXWS_SERVER_ADDRESS, greeterImpl);
    }
View Full Code Here

    @Override
    public void setUp() throws Exception {
        deleteDirectory("target/filetocxf");

        // set CXF
        ServerFactoryBean factory = new ServerFactoryBean();

        factory.setAddress("http://localhost:9001/router");
        factory.setServiceClass(HelloService.class);
        factory.setServiceBean(new HelloServiceImpl());

        server = factory.create();
        server.start();

        super.setUp();
    }
View Full Code Here

    private String serviceEndpointURI = "cxf://" + SERVICE_ADDRESS + "?" + SERVICE_CLASS + "&dataFormat=POJO";
   
    @BeforeClass
    public static void startService() {      
        //start a service
        ServerFactoryBean svrBean = new ServerFactoryBean();
   
        svrBean.setAddress(SERVICE_ADDRESS);
        svrBean.setServiceClass(HelloService.class);
        svrBean.setServiceBean(new HelloServiceImpl());
   
        server = svrBean.create();
        server.start();
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.frontend.ServerFactoryBean

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.