标签:方式 XML asmx weather sys mobile pre acl []
package me.gacl.ws.client;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import me.gacl.phonenum.MobileCodeWSSoap;
public class weatherService_Service {
public static void main(String[] args) throws Exception {
URL url = new URL("http://ws.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl");
// namespaceURI -- 命名空间地址
// localPart -- 服务视图名
QName qname = new QName("http://WebXml.com.cn/", "MobileCodeWS");
// serviceName --服务名称
// wsdlDocumentLocation -- wsdl地址
Service service = Service.create(url,qname);
// 获取service实现类
MobileCodeWSSoap mobileCodeWSSoap = service.getPort(MobileCodeWSSoap.class);
String mobileCodeInfo = mobileCodeWSSoap.getMobileCodeInfo("1861234","");
System.out.println(mobileCodeInfo);
}
}
代码如上,获取wsdl方式相同。
标签:方式 XML asmx weather sys mobile pre acl []
原文地址:http://www.cnblogs.com/duyunchao-2261/p/7448235.html