jar包:
activation.jar
axis.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
jaxrpc.jar
wsdl4j-1.5.1.jar
jar包下载地址:http://mirrors.hust.edu.cn/apache/axis/axis/java/1.4/
-----------------------------------------------------------默默无闻的分割线-----------------------------------------------------------
webService调用:
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public void getMobileCodeDBInfo() {
try {
String url = "http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx";
//命名空间
String soapaction = "http://WebXml.com.cn/";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new QName(soapaction, "getDatabaseInfo"));
call.setReturnType(new QName(soapaction, "getDatabaseInfo"),Vector.class);
call.setUseSOAPAction(true);
call.setSOAPActionURI(soapaction + "getDatabaseInfo");
Vector v = (Vector) call.invoke(new Object[] {});
for (int i = 0; i < v.size(); i++) {
System.out.println(v.get(i));
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。