{
…………………
}
wtcHome=(WtcInstanceHome)javax.rmi.PortableRemoteObject.narrow(obj, WtcInstanceHome.class);
try
{
wtcRemote = wtcHome.create();
}
catch (Exception e)
{
………….
}
callTestService(service_name);
try
{
wtcRemote.remove();
}
catch (Exception e)
{
………………
}
}
函数callTestService
public String callTestService (String service_name)
{
CallDescriptor tuxRtn = null;
TypedFML32 inParams = null, tuxResult = null;
try
{
//创建fml32缓冲区java描述类的实例
inParams = new TypedFML32(new student_fld());
//填写输入参数:学号
inParams.Fchg(student_fld.student_id , 0, getStudentId());
}
catch (Ferror e)
{
……
}
try
{ //异步调用tuxedo service.
tuxRtn = wtcRemote.Tpacall(service_name, inParams);
}
catch (Exception e)
{
………
}
try
{ //等待异步调用的service返回结果.
tuxResult = wtcRemote.Tpgetrply(tuxRtn);
}
catch (Exception e)
{
………
}
try
{
//得到学生的姓名和年龄…
stuName = (String)tuxResult.Fget(student_fld.student_name, 0);
stuAge = (Integer) tuxResult.Fget(student_fld.student_age, 0);
}
catch (Ferror e)
{
………
}
………
}