tags:

views:

151

answers:

1

Hello Gurus!

I have a POJO which is being deployed as a webservice in Axis2 - Tomcat combo. What is the best way to supply runtime configurations to the service? All servcie related config parameters are in XML file -

  1. What's the best location to keep this config file? Note I want the service to be completely self contained.

  2. How do I get the physical location of the service home i.e. Tomcat 6.0\webapps\axis2\WEB-INF\services\MyService?

  3. How good is Axis2 i.e. is it a good choice to select Axis2 as webservice platform? The project is with aggressive timelines (what's new? :)) so really do not wish to dive into the Contract First etc stuff. Need a quick solution where I can drop in POJO and use it as webservice.

As always, Your help is very much appreciated!

A: 

I used JNDI to control the runtime configuration options for simple web services. How to configure JNDI depends on the container you are using, Jetty/Tomcat etc.

More complicated projects I embed spring and manage both configuration and other persistent objects.

Axis2 is a good platform for developing stand-alone web services. I'd still recommend having a look at contract first stuff. It is of course more complicated but gives more control over the XML messages exchanged between client and server. The neat thing about Axis2 is that you can start with POJOs and get more complicated later.

Mark O'Connor
Thank you Mark. Will surely give contract first a shot, once the base service is established. Jndi would be too complex for our webservice.I came across this solution - Reading the config file from classpath using classloader and parse the cml using commn conifg. Let's see how this goes...
AAK