我在main()方法中通过Xfire远程调用WebService
public static void main(String[] args) throws MalformedURLException, Exception
{
Client client = new Client(new URL("http://192.168.1.114/QueryService?WSDL")); Object[] results = client.invoke("query", new Object[] {"user", "12345"}); System.out.println(results[0]);
}调用成功!也有返回的数据,都是正确的!但在另一个方法中public String getDataList(){
String ss = null;
try{ Client client = new Client(new URL("http://192.168.1.114/QueryService?WSDL"));//在执行这句话时就通不过,不会往下执行,也没报错! Object[] results = client.invoke("query", new Object[] {"user", "12345"}); ss = results[0].toString; }catch(MalformedURLException e){
........
}catch(Exception e)
........
}
return ss;
}希望大家帮帮忙,看是什么原因?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货