public String getService(String methodName, String xml) {
try {
String endpointURL = "http://219.136.207.188/mobtongbao/services/UmpsToGmccWS";
AxisProperties.setProperty("http.proxyHost", "10.243.184.17"); //代理IP
AxisProperties.setProperty("http.proxyPort", "8081"); //代理端口
AxisProperties.setProperty("http.proxyUser", "dwyaoyongsheng"); //用户名
AxisProperties.setProperty("http.proxyPassword", "yys963"); //密码
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(endpointURL);
call.addParameter("test", XMLType.XSD_STRING, ParameterMode.IN);
call.setOperationName(methodName);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
String ret = (String) call.invoke(new Object[] { new String(xml) });
return ret;
} catch (Exception e) {
return "";
}
}
Axis WebService例子
最新推荐文章于 2021-04-13 17:32:46 发布