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