xfire调用webService接口方法
/**
* 获取连接对象
*/
private static Client getClient() {
synchronized (XXXService.class) {
if (client == null) {
try {
client = new Client(new URL("http:XXXX?wsdl"));
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
return client;
}
// Client client = getClient();
// Object[] results = null;
// try {
// //调用特定的Web Service方法
// results = client.invoke("verifyRegister", new Object[] { idNo,
// idType,name});
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (results == null)
// System.out.println("zero");
// else{
// for (int i = 0; i < results.length; i++) {
// System.out.println(results[i].toString());
// }
// }
本文介绍使用xfire库调用WebService接口的方法。通过示例代码展示了如何创建客户端连接、调用特定的WebService方法并处理返回结果。
2498

被折叠的 条评论
为什么被折叠?



