I figured out a solution and didn't want to leave this thread completely unanswered.
This actually can be done. At a high level the WAR needs to expose an OSGI service that implements an interface that is in yet a third bundle. This is because a WAR file cannot directly expose POJO (including interfaces) through OSGI, but it can register services with the OSGI registry. The interface can be simple enough [eg. start, stop]. For the implementing class in the WAR look at javax.xml.ws.Endpoint. In the xml where you define the osgi service, make sure to include context-class-loader="service-provider", as that will ensure execution in the correct memory space. Then in the client, just use the OSGI service like any other. Just make sure that the client bundle has access to the interface defined above, as you will need it. Thanks. Raughan wrote: > > I am playing around with CXF (as a Web Service with auto-generated wsdl) > and OSGI (via Spring-DM), and already have a working hello world type > application. Now I want to take this to the next level and am hoping > someone might have some pointers to get me started. > > So what I want to do is have multiple wsdl enabled "services" on the same > CXF instance (say HelloWorld?wsdl and GoodbyeWorld?wsdl). But I want the > code for each "service" to be an OSGI bundle and then the CXF instance > would be some kind of stand-alone > http://static.springsource.org/s2-dmserver/2.0.x/programmer-guide/html/ch06s04.html > Shared Services WAR . The WAR file would be unaware of what "services" (or > OSGI bundles) exist. Rather when the bundles are brought online they would > plug themselves into the CXF instance automatically via OSGI, taking full > advantage of CXF including the auto-generated wsdl. > > The goal ultimately being a web service that is able to dynamically add > and remove services via OSGI. This would allow for highly flexible web > services with many advantages. > > I understand that this is perhaps a bit on the theoretical side, but any > help in figuring out how to do this would be appreciated. > > Thanks. > -- View this message in context: http://old.nabble.com/Dynamic-CXF-WebService-powered-by-OSGI-tp26286490p26374693.html Sent from the cxf-user mailing list archive at Nabble.com.
