Hello Friends,
I wrote a simple java service and deployed using jwsdp-1_0_01 tools kit.
My service need to read some configuration information for processing it.
I kept the file in "/home/jagan/jwsdp-1_0_01/work/Standard\ Engine/localhost/hello-jaxrpc/WEB-INF/classes"
that where the application was deployed.
==========================================
My scripts for service is as follows for service implementation
------------------------------------
package hello;
import java.util.Hashtable;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.StringTokenizer;
import java.io.*;
public class HelloImpl implements HelloIF {
public String sayHello(String s) {
Hashtable file_location = new Hashtable();
String line;
StringBuffer buf = new StringBuffer();
try {
BufferedReader in = new BufferedReader(new InputStreamReader(
new FileInputStream("file_location.data"), "JISAutoDetect"));
while(true) {
String str = in.readLine();
if(str == null) { break; }
StringTokenizer
tokens = new StringTokenizer(str, " ");
file_location.put(tokens.nextToken(),tokens.nextToken());
}
}
catch(FileNotFoundException e)
{
}
catch(UnsupportedEncodingException e1)
{
}
catch(IOException e2)
{
}
if(file_location.containsKey(s))
{
return file_location.get(s)+"";
}
else
{
return "No data found on server for " + s;
}
}
}
=================================================================
In fact while packaging the files, I packaged the
data file along with other class files. While
deploying, the tool kept at this location.
Where do I need to keep for my web service to read
text file.
Is there any body have any idea.
with regards,
Jagan
===========================================