axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim McCarthy <>
Subject Re: Best way to load a configuration file in Axis2?
Date Wed, 06 May 2009 17:00:29 GMT
I have read in XSD files for validating incoming XML parametrers to my web service. Use Class
Loader and getResourceAsStream using the XML file as a parameter. Using this assumes you are
trying to access the XML from the service where the XML file resides.
You should be able to access the XML file if it's in your classpath. You can place it in the
root of the AAR or in your classes folder. The 'sFilePath' variable below will hold web path
and name of your XML file. If the XML is in the root folder of the AAR, then no path will
be required.
sFilePath can be set to: 
       sFilePAth = "myXMLFile.xml"
ClassLoader loader = getClass().getClassLoader();
InputStream inputstream = loader.getResourceAsStream(sFilePath);

--- On Wed, 5/6/09, Moley Harey <> wrote:

From: Moley Harey <>
Subject: Best way to load a configuration file in Axis2?
Date: Wednesday, May 6, 2009, 4:17 PM


I am implementing a web service using Axis2 that can be tunned using several configuration
parameters. My web service is deployed as *.aar file into the axis2/WEB-INF/services folder.

I have done a separate XML configuration file that store those parameters, my idea was to
include the configuration file into de final *.aar file and then try to load that configuration
file in my code without the need to specify the full path on disk where it is placed. 

Is is possible to do this in Axis2? Can I use some kind of "ServiceContext" to do this?

Thanks in advance,


View raw message