Hi, Multiple endpoints are supported out of the box.
Take a look into integration tests, for example https://github.com/apache/cxf/blob/master/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerServer.java Server publishes the multiple endpoints. Regards, Andrei. > -----Original Message----- > From: God Dang [mailto:[email protected]] > Sent: Mittwoch, 29. Juni 2016 16:26 > To: [email protected] > Subject: RE: Problem with multiple ports for one Service > > I've been trying this oldie: http://cxf.547215.n5.nabble.com/Deploying- > multiple-endpoints-ports-for-a-service-td569470.htmlbut can't get it to work. > Are people still using CXF? Most examples and code that you find when > searching how to solve this seem to be really old... > /dang > > From: [email protected] > To: [email protected] > Subject: Problem with multiple ports for one Service > Date: Mon, 27 Jun 2016 19:00:31 +0000 > > > > > I'm trying to develop a Server that serves two "services" using different > ports in > the WSDL, i.e.--- 8< --- > <wsdl:service name="Service"> <wsdl:port name="ServicePort-v1" > binding="service:ServiceBinding-v1"> <soap:address > location="http://uri/Service/v1"/> </wsdl:port> <wsdl:port > name="ServicePort-v2" binding="service:ServiceBinding-v2"> > <soap:address location="http://uri/Service/v2"/> </wsdl:port> > </wsdl:service>--- 8< --- > > I've implemented two services using:--- 8< --- > @WebService ( serviceName = "Service", portName = "ServicePort- > v1", wsdlLocation = "WEB-INF/Service.wsdl", targetNamespace = > "http://uri/Service")public class MyService1 {...}--- 8< --- > @WebService ( serviceName = "Service", portName = "ServicePort- > v2", wsdlLocation = "WEB-INF/Service.wsdl", targetNamespace = > "http://uri/Service")public class MyService2 {...}--- 8< --- > > And then starting the services using:--- 8< --- > final Service1 implementor1 = new Service1(...); final > JaxWsServerFactoryBean serverFactoryBean1 = new > JaxWsServerFactoryBean(); > serverFactoryBean1.setServiceClass(Service1.class); > serverFactoryBean1.setAddress(address + "/v1"); > serverFactoryBean1.setServiceBean(implementor1); > serverFactoryBean1.getServiceFactory().setInvoker(new > JAXWSMethodInvoker(implementor1)); > Server server1 = serverFactoryBean1.create(); > > final Service2 implementor2 = new Service2(...); final > JaxWsServerFactoryBean serverFactoryBean2 = new > JaxWsServerFactoryBean(); > serverFactoryBean2.setServiceClass(Service2.class); > serverFactoryBean2.setAddress(address + "/v2"); > serverFactoryBean2.setServiceBean(implementor2); > serverFactoryBean2.getServiceFactory().setInvoker(new > JAXWSMethodInvoker(implementor2)); > Server server2 = serverFactoryBean2.create();--- 8< --- > > But only the second service is working. When I start them one at a time > they're > working so the underlying implementation is good. I can't seem to find a good > way to create a Server that can route on multiple ports(WSDL-ports that is). > I've searched long and hard but have yet to find any recent information on how > to go about this and would be very grateful for any pointers. > Regards, Dang > >
