Search in sources :

Example 6 with SoapTransportFactory

use of org.apache.cxf.binding.soap.SoapTransportFactory in project dubbo-spi-extensions by apache.

the class WebServiceProtocol method doExport.

@Override
protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
    transportFactory = new SoapTransportFactory();
    destinationRegistry = new DestinationRegistryImpl();
    String addr = getAddr(url);
    ProtocolServer protocolServer = serverMap.get(addr);
    if (protocolServer == null) {
        RemotingServer remotingServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, new ProxyProtocolServer(remotingServer));
    }
    serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
    serverFactoryBean.setServiceClass(type);
    serverFactoryBean.setServiceBean(impl);
    serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
    serverFactoryBean.getServiceFactory().getConfigurations().add(new URLHashMethodNameSoapActionServiceConfiguration());
    server = serverFactoryBean.create();
    return new Runnable() {

        @Override
        public void run() {
            if (serverFactoryBean.getServer() != null) {
                serverFactoryBean.getServer().destroy();
            }
            if (serverFactoryBean.getBus() != null) {
                serverFactoryBean.getBus().shutdown(true);
            }
            ProtocolServer httpServer = serverMap.get(addr);
            if (httpServer != null) {
                httpServer.close();
                serverMap.remove(addr);
            }
        }
    };
}
Also used : ProtocolServer(org.apache.dubbo.rpc.ProtocolServer) RemotingServer(org.apache.dubbo.remoting.RemotingServer) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) SoapTransportFactory(org.apache.cxf.binding.soap.SoapTransportFactory) DestinationRegistryImpl(org.apache.cxf.transport.http.DestinationRegistryImpl)

Example 7 with SoapTransportFactory

use of org.apache.cxf.binding.soap.SoapTransportFactory in project cxf by apache.

the class AbstractSimpleFrontendTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUpBus();
    Bus bus = getBus();
    SoapBindingFactory bindingFactory = new SoapBindingFactory();
    bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
    DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
    SoapTransportFactory soapTF = new SoapTransportFactory();
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapTF);
    LocalTransportFactory localTransport = new LocalTransportFactory();
    localTransport.getUriPrefixes().add("http");
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
    dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
    ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
    extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
    extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", soapTF);
}
Also used : Bus(org.apache.cxf.Bus) SoapBindingFactory(org.apache.cxf.binding.soap.SoapBindingFactory) DestinationFactoryManager(org.apache.cxf.transport.DestinationFactoryManager) LocalTransportFactory(org.apache.cxf.transport.local.LocalTransportFactory) ConduitInitiatorManager(org.apache.cxf.transport.ConduitInitiatorManager) BindingFactoryManager(org.apache.cxf.binding.BindingFactoryManager) SoapTransportFactory(org.apache.cxf.binding.soap.SoapTransportFactory) Before(org.junit.Before)

Example 8 with SoapTransportFactory

use of org.apache.cxf.binding.soap.SoapTransportFactory in project dubbo by apache.

the class WebServiceProtocol method doExport.

@Override
protected <T> Runnable doExport(T impl, Class<T> type, URL url) throws RpcException {
    transportFactory = new SoapTransportFactory();
    destinationRegistry = new DestinationRegistryImpl();
    String addr = getAddr(url);
    ProtocolServer protocolServer = serverMap.get(addr);
    if (protocolServer == null) {
        RemotingServer remotingServer = httpBinder.bind(url, new WebServiceHandler());
        serverMap.put(addr, new ProxyProtocolServer(remotingServer));
    }
    serverFactoryBean = new ServerFactoryBean();
    serverFactoryBean.setAddress(url.getAbsolutePath());
    serverFactoryBean.setServiceClass(type);
    serverFactoryBean.setServiceBean(impl);
    serverFactoryBean.setBus(bus);
    serverFactoryBean.setDestinationFactory(transportFactory);
    serverFactoryBean.getServiceFactory().getConfigurations().add(new URLHashMethodNameSoapActionServiceConfiguration());
    server = serverFactoryBean.create();
    return new Runnable() {

        @Override
        public void run() {
            if (serverFactoryBean.getServer() != null) {
                serverFactoryBean.getServer().destroy();
            }
            if (serverFactoryBean.getBus() != null) {
                serverFactoryBean.getBus().shutdown(true);
            }
            ProtocolServer httpServer = serverMap.get(addr);
            if (httpServer != null) {
                httpServer.close();
                serverMap.remove(addr);
            }
        }
    };
}
Also used : ProtocolServer(org.apache.dubbo.rpc.ProtocolServer) RemotingServer(org.apache.dubbo.remoting.RemotingServer) ServerFactoryBean(org.apache.cxf.frontend.ServerFactoryBean) SoapTransportFactory(org.apache.cxf.binding.soap.SoapTransportFactory) DestinationRegistryImpl(org.apache.cxf.transport.http.DestinationRegistryImpl)

Aggregations

SoapTransportFactory (org.apache.cxf.binding.soap.SoapTransportFactory)8 BindingFactoryManager (org.apache.cxf.binding.BindingFactoryManager)4 SoapBindingFactory (org.apache.cxf.binding.soap.SoapBindingFactory)4 DestinationFactoryManager (org.apache.cxf.transport.DestinationFactoryManager)4 LocalTransportFactory (org.apache.cxf.transport.local.LocalTransportFactory)4 ServerFactoryBean (org.apache.cxf.frontend.ServerFactoryBean)3 ConduitInitiatorManager (org.apache.cxf.transport.ConduitInitiatorManager)3 DestinationRegistryImpl (org.apache.cxf.transport.http.DestinationRegistryImpl)3 RemotingServer (org.apache.dubbo.remoting.RemotingServer)3 ProtocolServer (org.apache.dubbo.rpc.ProtocolServer)3 Before (org.junit.Before)3 Bus (org.apache.cxf.Bus)2 WSDLManagerImpl (org.apache.cxf.wsdl11.WSDLManagerImpl)1 JaxWsServiceReference (org.apache.openejb.core.ivm.naming.JaxWsServiceReference)1 WebServiceInjectionConfigurator (org.apache.openejb.server.cxf.client.WebServiceInjectionConfigurator)1