Hi all,

I am searching all day for a way to open and read XML-resource files.

If there is no archive file it runs fine, but the trouble starts when I
create an .aar file.

I have seen some messages in the archive, but, they were not helpful. I
have the problem in Tomcat in SimpelAxisserver

Isn't there a standards way to do this, there must be many people who
want to configure there webservice with XML-file?

So let me explain my problem.

This code I am using to open a file:

AxisService axisService =
MessageContext.getCurrentMessageContext().getAxisService();
ClassLoader serviceClassLoader = axisService.getClassLoader();
URL res = serviceClassLoader.getResource("SecurityOptions.xml");

First I had the XML-file in different places inside the .aar. In
META_INF, in the root Did not work. It gave me *null* as URL back

Then I read somewhere the file shouldn't be in the .aar, and that is
right, the purpose is to make the service configurable.

It should be in classes (in Tomcat) or in the repository/services-root
from AxisSimpleServer

I think this will be messy, because, when there are more services, and
they all put files in the same directory?

Anyway, if that works, I go to bed satisfied
And it works a bit:
This gives a good URL back:
file:/home/verhees/Axis2/ServiceTest/repository/services/SecurityOptions.xml

But when I try to parse it (open it) I get an Exception from SAX:
org.apache.axis2.AxisFault: org/dom4j/io/SAXReader

I cannot get a stacktrace or message visible, but, I think it has to do
with not being able to open the file.

If someone has an idea what to do, or if there is a clear instruction
how to handle/place XML-config files for a webservice, it will help me a
lot.

Thanks in advance
Bert Verhees

Reply via email to