您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。