F
Fingolfin
Hello,
I'm having trouble accessing a file in a Web Service that I'm making:
String dat = "config.xml";
@WebMethod(operationName = "operation")
public String[] operation(@WebParam(name = "parameter")
String parameter, @WebParam(name = "parameter1")
String parameter1) {
try {
fis = new FileInputStream(dat);
print = "File found";
} catch (FileNotFoundException ex) {
print = ex.toString();
}
After executing at the client there is a following error:
Result1 = java.io.FileNotFoundException: config.xml (The system cannot
find the path specified)
The config.xml file is currently both in root and in WEB-INF folder and
still the file can't be found.
The same code works _perfectly_ in ordinary Java Main Class in Java
(non-web) Application.
Am I writing the path wrong or something else?
I'm having trouble accessing a file in a Web Service that I'm making:
String dat = "config.xml";
@WebMethod(operationName = "operation")
public String[] operation(@WebParam(name = "parameter")
String parameter, @WebParam(name = "parameter1")
String parameter1) {
try {
fis = new FileInputStream(dat);
print = "File found";
} catch (FileNotFoundException ex) {
print = ex.toString();
}
After executing at the client there is a following error:
Result1 = java.io.FileNotFoundException: config.xml (The system cannot
find the path specified)
The config.xml file is currently both in root and in WEB-INF folder and
still the file can't be found.
The same code works _perfectly_ in ordinary Java Main Class in Java
(non-web) Application.
Am I writing the path wrong or something else?