Hi,
I have an issue when i call a third party web service from
thread. The example code I have given below.
This code is used to process incoming file. First process method will validate the inputs. then it will do virus scan on the file. for which we have to call a third party webs service.
I am starting the thread because I have to return to caller whether file valid or not and processing is done inside the thread. I have added debug statements inside the thread and virus scan method.
It coming inside the virus scan method, but stops in between without doing virus scan.
Please anybody can help me on this issue.
public class ProcessWS {
public ProcessWS() {
}
public
String process(String filename,String srno){
if (filename==null || "".equals(filename) || srno==null || "".equals(srno)){
//log input values are invalid.
return "Invalid input parameters";
}
new Thread(new MyThread(filename,srno)).start();
return "Validations done.Process is started.";
}
class MyThread implements Runnable{
String fn=null;
String srnumber = null;
MyThread(String filename, String srno){
fn = filename;
srnumber = srno;
}
public void run() {
VirusScan vs = new VirusScan();
vs.doVirusScan(fn,srnumber);
// .doVirusScan(fn,srnumber);
}
}
}
Thanks ,
Rakesh