You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Richard Alan Herz <ri...@ce-bis.de> on 2004/04/09 18:27:11 UTC
service initializing when axis starts up
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.
------------
Richard Alan Herz, Dipl. Wirtsch. Inf.
Ce-bIS, Otto-Friedrich-Universität Bamberg
Centre of business information systems
Kronacher Straße 41
D-96052 Bamberg
Phone +49 (0)951 4 07 63-14
Fax +49 (0)951 4 07 63-29
Mail richard-alan.herz@ce-bis.de
*** Ce-bIS @ CeBIT Asia 2004 (Shanghai, 26. - 29.4): Future Parc
Re: service initializing when axis starts up
Posted by Gareth Western <p2...@garethwestern.com>.
Hiya,
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.
>
>
>