How to deploy CXF SOAP web service on tomcat instead of jetty server
if i try to use tomcat port to run ServerFactoryBean
it is showing an error:
port already running.
Is there any way to use tomcat instead of in-build jetty server?
Following is my code that i am trying to create a Server.
SoapBindingFactory bindingFactory = new SoapBindingFactory();
Bus bus = BusFactory.newInstance().createBus();
bindingFactory.setBus(bus);
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
bus.getExtension(BindingFactoryManager.class).registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/http", bindingFactory);
Service service = new WSDLServiceFactory(bus, "wsdl path here", null).create();
ServerFactoryBean serverFactory = new ServerFactoryBean();
serverFactory.setBus(bus);
InboundRMHttpInvoker invoker = new InboundRMHttpInvoker(serviceImpl);
serverFactory.setInvoker(invoker);
serverFactory.setServiceBean(serviceImpl);
serverFactory.setDataBinding(service.getDataBinding());
serverFactory.setServiceName(service.getName());
serverFactory.setBindingId(service.getServiceInfos().get(0).getBindings().iterator().next().getBindingId());
serverFactory.setWsdlLocation("wsdl path");
serverFactory.setEndpointName(service.getServiceInfos().iterator().next().getEndpoints().iterator().next().getName());
serverFactory.setAddress("http://localhost:8080/services/sampleservice");
Server server = serverFactory.create();
If I use another port (other than tomcat) then it deploy my service on that port but how to run it on tomcat port.