主题:Delphi调用Java函数
用Delphi调用Java写的函数来登录WebServer,但是每次调用函数CallStaticObjectMethod时都失败,调用的函数为:
public class TestLogin {
public static String dLogin(String[] args) {
try {
String endpoint = "http://localhost/tms/services/login";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTimeout(-1);
call.setOperationName(new QName(endpoint, "login"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[] { "admin02", "123456" });
return ret;
} catch (Exception e) {
return "bbb";
}
}
}
但是如果没有try里面的部分的话调用是成功的,希望各位大虾解惑.
或者怎样直接用Delphi来实现这段代码呢?
public class TestLogin {
public static String dLogin(String[] args) {
try {
String endpoint = "http://localhost/tms/services/login";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTimeout(-1);
call.setOperationName(new QName(endpoint, "login"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[] { "admin02", "123456" });
return ret;
} catch (Exception e) {
return "bbb";
}
}
}
但是如果没有try里面的部分的话调用是成功的,希望各位大虾解惑.
或者怎样直接用Delphi来实现这段代码呢?