I have the following environment:
- Tomcat 5.5.30
- Java 6
- JAX-WS RI 2.1
My main web application is made of several smaller Java Projects, like this:
- MainApplication (web project): has no code on it, except for some configuration files.
- ClientModule (java project): has client related webservices (add, change and remove clients)
- BillingModule (java project): has billing related webservices (billing processing routines)
- ParameterModule (java project): has application parameter related webservices (change application settings)
- And few other modules
Right now webservices from all modules are add to “sun-jaxws.xml” in the MainApplication and registered automagically by JAX-WS servlet set on “web.xml”. But the idea of the application is to allow us to distribute the application without some of the modules if required using minimum changes to configuration files to avoid mistakes.
My idea was to create a META-INF Service, and on application initialization look up these services from each module, then ready my own “sun-jax.xml” in each java project and register the webservices manually.
Besides allowing us to distribute only the desired modules, it would make the development easier since I can only deploy the modules I’m working on when deploying MainApplication.
So, how do I register these webservices manually (or rather programmatically)?
Sérgio
I was able to accomplish this by creating the “sun-jaxws.xml” dynamically in my class that implements
javax.Servlet.ServletContextListenerinterface.