Jolt调用Tuxedo服务
JoltSession session;
JoltSessionAttributes sattr;
JoltRemoteService toupper;
JoltTransaction trans;
String userName=null;
String userPassword=null;
String appPassword=null;
String userRole="myapp";
String outstr;
// if(args.length!=1) {
// System.out.println("usage:java Test string");
// }
sattr=new JoltSessionAttributes();
sattr.setString(sattr.APPADDRESS,"//10.1.25.5:7788");
switch(sattr.checkAuthenticationLevel())
{case JoltSessionAttributes.NOAUTH:
System.out.println("NOAUTH...");
break;
case JoltSessionAttributes.APPASSWORD:
System.out.println("APPASSWORD...");
appPassword="1234567";
break;
case JoltSessionAttributes.USRPASSWORD:
System.out.println("USRPASSWORD...");
userName="system";
userPassword="1234567";
appPassword="1234567";
break;
}
sattr.setInt(sattr.IDLETIMEOUT,300);
session=new JoltSession(sattr,userName,userRole,userPassword,appPassword);
toupper=new JoltRemoteService("TOUPPER",session);
toupper.setString("STRING",args[0]);
toupper.call(null);
outstr=toupper.getStringDef("STRING",null);
if(outstr!=null)
System.out.println(outstr);
session.endSession();