在command下输入
F:\test>wsimport -keep -p com.wsclient http://webservice.webxml.com.cn/WebServic
es/MobileCodeWS.asmx?WSDL
会自动在F:\test下生成一些类,自动生成的会有报错,可以自己改下
以下是简单的java代码调用:
package test; import java.util.List; import com.wsclient.ArrayOfString; import com.wsclient.MobileCodeWS; import com.wsclient.MobileCodeWSSoap; public class Test { public static void main(String[] args) { MobileCodeWS mcws = new MobileCodeWS(); MobileCodeWSSoap mcwss = mcws.getMobileCodeWSSoap(); ArrayOfString aos = mcwss.getDatabaseInfo(); List<String> list = aos.getString(); for(String str : list){ System.out.println(str); } String location = mcwss.getMobileCodeInfo("1583510", ""); System.out.println(location); } }