Hi, I am new to Webservice concepts.I had a client and server side application.There is a property file in Serverside.I am trying to read the data from property file using the following code Properties props = new Properties(); try { props.load(new FileInputStream("StatementType.properties")); statementType = props.getProperty("statementdefintionName"); } catch(IOException e){e.printStackTrace();} I have placed the property file under WebContent folder.
While making a call from Client side and invoke the webservice,it is throwing a FileNotfound exception as it is unable to locate the file.Please let me know why during a webservice call,it is unable to locate a file in server side.
That code depends on the "current" directory - something you have no control over in typical servers. You will need to find a way to get the absolute path to the properties file. What server are you using?
You obtain the ServletEndpointContext in an JAX-RPC servlet by implementing the javax.xml.rpc.server.ServiceLifecycle - the ServletEndpointContext is passed through the init method.
So basically you have to find a way of obtaining the your ServletContext.