I have deployed an Axis 1.2.1 web service within
Tomcat 5.0.28 container. The web service is supposed to read an XML file. I have used Castor to serialize the XML file into
Java Classes. I developed this application under Eclipse as a standalone Java application. It works perfectly. When I try to move it to the Axis Web Service running within the Tomcat Container however, I ran into trouble. Specifically, the Web Service cannot find the XML file (mapping.xml and the datafile containing XML data to be read into Java classes). I did some research and tried to copy this file just about everywhere, i.e. in the WEB-INF directory, in the classes directory, etc. but no luck, the web service cannot find it. I understand that within the
Servlet container you get the path using getRealPath function of the ServletConfig object. However, that does not work either. I have seen various postings to the effect that Axis MsgContext object can give the ServletContext object, but do not know how. I would really appreciate it if someone can post a code snippet showing how to read the path for a file to be read from within an Axis web service running within the Tomcat container. The imports will help too.
Thanks in advance.
Bharat
SCJP,SCJD,SCWCD,SCBCD,SCDJWS,SCEA