Axis下WebService,call.invoke()无返回值

String endpoint = "http://211.156.198.50/services/LoginSystem?wsdl";
Service service = new Service();
String result = "no result!";
Object[] object = new Object[1];
object[0] = xxdz;//Object是用来存储方法的参数
Call call;
try{
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));// 远程调用路径
call.setOperationName("convertAddress2LongLatGPS");// 调用的方法名
// 设置参数名:
call.addParameter("xxdz", // 参数名
XMLType.XSD_STRING,// 参数类型:String
ParameterMode.IN);// 参数模式:'IN' or 'OUT'
// 设置返回值类型:
call.setReturnType(XMLType.XSD_STRING);// 返回值类型:String
System.out.println(object[0]);
result = (String) call.invoke(object);// 远程调用
System.out.println("fdfd");
System.out.println(result);
} catch (ServiceException e) {

第1个回答  2015-04-17
// 设置参数名:
call.addParameter("xxdz", // 参数名
XMLType.XSD_STRING,// 参数类型:String
ParameterMode.IN);// 参数模式:'IN' or 'OUT'

参数名用arg0..arg8,不要用真实参数名,试试吧
第2个回答  2017-06-13
改动这里:
result = (String) call.invoke(new Object[] { strXmlBody });
第3个回答  2016-12-16
楼主解决了吗?我的程序也卡在call.invoke();这一步了。
相似回答