Hi
 
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"
or   
 
ClassLoader loader = getClass().getClassLoader();
InputStream inputstream = loader.getResourceAsStream(sFilePath);
 
Kim

--- On Wed, 5/6/09, Moley Harey <moleyha...@gmail.com> wrote:


From: Moley Harey <moleyha...@gmail.com>
Subject: Best way to load a configuration file in Axis2?
To: axis-user@ws.apache.org
Date: Wednesday, May 6, 2009, 4:17 PM


Hi,

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,

Mh



      

Reply via email to