Search in sources :

Example 6 with ServerFactoryBean

use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.

the class CxfProducerSynchronousFalseTest method startServer.

@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(BusFactory.getDefaultBus());
    svrBean.create();
}
Also used : ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) BeforeClass(org.junit.BeforeClass)

Example 7 with ServerFactoryBean

use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.

the class CxfProducerSynchronousTest method startServer.

@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(BusFactory.getDefaultBus());
    svrBean.create();
}
Also used : ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) BeforeClass(org.junit.BeforeClass)

Example 8 with ServerFactoryBean

use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.

the class FileToCxfMessageDataFormatTest method setUp.

@Override
public void setUp() throws Exception {
    deleteDirectory("target/filetocxf");
    // set CXF
    ServerFactoryBean factory = new ServerFactoryBean();
    factory.setAddress("http://localhost:" + port1 + "/FileToCxfMessageDataFormatTest/router");
    factory.setServiceClass(HelloService.class);
    factory.setServiceBean(new HelloServiceImpl());
    server = factory.create();
    server.start();
    super.setUp();
}
Also used : ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) HelloServiceImpl(org.apache.camel.component.cxf.HelloServiceImpl)

Example 9 with ServerFactoryBean

use of org.apache.cxf.frontend.ServerFactoryBean in project dubbo by alibaba.

the class WebServiceProtocol method doExport.

protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
    String addr = url.getIp() + ":" + url.getPort();
    HttpServer httpServer = serverMap.get(addr);
    if (httpServer == null) {
        httpServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, httpServer);
    }
    final ServerFactoryBean serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
    serverFactoryBean.setServiceClass(type);
    serverFactoryBean.setServiceBean(impl);
    serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
    serverFactoryBean.create();
    return new Runnable() {

        public void run() {
            serverFactoryBean.destroy();
        }
    };
}
Also used : HttpServer(com.alibaba.dubbo.remoting.http.HttpServer) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean)

Example 10 with ServerFactoryBean

use of org.apache.cxf.frontend.ServerFactoryBean in project camel by apache.

the class CxfProducerRouterTest method startServer.

@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(BusFactory.getDefaultBus());
    svrBean.create();
}
Also used : ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) BeforeClass(org.junit.BeforeClass)

Aggregations

ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)15 BeforeClass (org.junit.BeforeClass)8 Server (org.apache.cxf.endpoint.Server)2 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 Before (org.junit.Before)2 HttpServer (com.alibaba.dubbo.remoting.http.HttpServer)1 QName (javax.xml.namespace.QName)1 HelloServiceImpl (org.apache.camel.component.cxf.HelloServiceImpl)1 GreeterImpl (org.apache.hello_world_soap_http.GreeterImpl)1