I was trying to do this recently, doing the 'setting up' in a seperate servlet (using the servlets init() method), however the problem was I couldn't get Axis to talk to that external servlet. So in the end I did what I should have done all along and just wrote a seperate class to do all the setting up and then created an instance of that class in the Axis web service (using service application scope to maintain the object throughout the service lifetime). I'm not sure if this is the best way to do things, though...
So i guess the answer to your question is: Just write another class to do your setting up, then call that class from the service?
Cheers,
Gareth :)
Richard Alan Herz wrote:
Hello!
I've implemented successfully a web service with axis using handlers, wsdl2java, etc.
Now I want to run some initial routines before my service is available, so they should be called when axis starts up. For example a database shall be prepared before my web service accesses it and things like that.
My Question: Is there a mechanism with axis to support this kind of service initializing? maybe like the way e.g. handlers for requests/ responses work? Or do I have to do it outside from Axis by starting the routines manually before starting axis.
Thanks a lot for your help,
Rick.
