调用webservice查询信息
/**
* 回调,报名号,学号,状态
* @param RegNumber
* @return
*/
public static String webServiceBackScore(String regNumber,String stuNumber,String status) {
// 创建动态客户端
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient("http://219.144.130.166/UionWebService/services/SXJYWebDataService?wsdl");
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setConnectionTimeout(2000); // 连接超时
httpClientPolicy.setAllowChunking(false); // 取消块编码
httpClientPolicy.setReceiveTimeout(120000); // 响应超时
conduit.setClient(httpClientPolicy);
Object[] objects = new Object[0];
// invoke("方法名",参数1,参数2,参数3....);
String param = "<?xml version='1.0' encoding='UTF-8'?><body><xgxjx_xsbkxx>"
+ "<xh>"+stuNumber+"</xh>"
+ "<skbmid>"+regNumber+"</skbmid>"
+ "<jfbz>"+status+"</jfbz>"
+ "</xgxjx_xsbkxx></body>";
try {
objects = client.invoke("exchangeData","U04034201","11160001","U2", param);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("返回数据:" + objects[0]);
return objects[0].toString();
}