axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramon Turnes <>
Subject RE: Passing Start-Up Parameters to a WEB Service
Date Fri, 13 Sep 2002 07:46:58 GMT
We are doing the following, we have a Web Service whose scope is application
and auto configures the first time is invoked. This is a snippet of the code
are using:

//Here you have the deployment file
 <service name="MyService" provider="java:MSG" >
    <parameter name="className"       value="myServiceClass"/>
    <parameter name="allowedMethods"  value="entryPoint"/>
    <parameter name="configFile"
    <parameter name="scope"           value="application"/>

//Configuration method
    private Document getConfiguration(MessageContext msgc) {
        Document    config = null;
        InputStream is     = null;

        //Reads a option from the deployment information
        String filename = (String) msgc.

        try {
            //Search for a default file if no option is provided
            if (filename == null) {
               //When running under Tomcat this would point to 
                String servletLocation = (String) msgc.

                if (servletLocation != null) {
                    filename = servletLocation + "/" +
                } else {
                    filename = CONFIG_FILENAME;
                is = new FileInputStream(filename);
            } else {
                is = new FileInputStream(filename);
        } catch (FileNotFoundException e) {
  "getConfiguration(): file " + filename + " not found");
            return null;

        try {
            DocumentBuilder docBuilder =

            config = docBuilder.parse(is);
        } catch (Exception e) {
            log.debug("getconfiguration() : error parsing config file");
            return null;

        return config;

We did not file any other way of defining it. Regards.

-----Original Message-----
From: Smith, Larry []
Sent: Friday, September 13, 2002 1:50 AM
To: ''
Subject: RE: Passing Start-Up Parameters to a WEB Service

We have a pre-defined environment in which to work; ldap/jndi are 
not an option..... 
The service(s) have a "re-read your config" method that will be called 
by other apps which change things of interest to the service(s). 
So, we need either: 
        a) the ability for the service to find it's "home" directory at
        b) a way to pass dynamic start-up args which can (among other
           define the "home" directory. 
Thanks & Regards, 
-----Original Message----- 
From: Steve Loughran [] 
Sent: Thursday, September 12, 2002 6:42 PM 
Subject: Re: Passing Start-Up Parameters to a WEB Service 

you can put config stuff into web.xml 
Talking to a directory service (ldap/jndi) is widely recognised as better, 
as you can change stuff on a live system without a rebuild. 
----- Original Message ----- 
From: "Smith, Larry" <> 
To: <> 
Sent: Thursday, September 12, 2002 3:32 PM 
Subject: Passing Start-Up Parameters to a WEB Service 

> Is there any way to pass start-up parameters to a WEB Service running 
> under Axis? 
> I've tried adding an init() method, but it never gets invoked. 
> I've tried adding custom <parameter.../> entries to deploy.wsdd 
> We need a way to tell a WEB Service where to find various config 
> files and directories, which database to use, etc, when it starts up. 
> See the message thread for "Finding a WEB Service's Directory" for 
> info about the in-ability to determine the services "home" directory. 
> Since we can't portably derive the service's "home" directory, then the 
> ability to supply it with start-up parameters could be used to 
> accomplish the same task. 
> Thanks & Regards, 
> Larry 

View raw message