hi guys,
Im new to this group and hope u dont mind my asking...I created a web
service client using WSDK 5.1 (websphere application client). When i
run it in websphere it works fine.. it
uses "java:env/comp/service/OasysTest" as the jndi lookup... however,
it is supposed to be standalone swing application so I need to run it
from command line. from what i gathered this kind of lookup wont work
in standalone app..so i made some revisions.. however, i cant seem to
get it right since it wont run anymore..i keep getting th
error "javax.naming.NameNotFoundException:
service/OasysTestService" .. this is my first time to develop a
webservice..is someone kind enuff to tell me what im doing wrong..
pls see the code fragment below:
public String extractOasysFile(int userid, String branchId){
String oasysMsg = "";
InitialContext ic = null;
OasysTestService factory = null;
Hashtable env = new Hashtable();
env.put
(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitial
ContextFactory");
env.put(Context.PROVIDER_URL, "iiop://202.138.137.71:2809");
try{
ic = new InitialContext(env);
factory = (OasysTestService)ic.lookup("service/OasysTestService");
}catch (NamingException e){
e.printStackTrace();
}
try{
OasysTest ot = factory.getOasysTest();
try{
oasysMsg = ot.extractOasysFile(userid,branchId);
}catch(RemoteException e){
e.printStackTrace();
}
}catch(ServiceException se){
se.printStackTrace();
}
return oasysMsg;
}