JAX-WS获取天气预报wsdl
程序员文章站
2022-03-25 21:27:38
...
天气预报地址:http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl
package cn.com.WebXml;
/**
* @author: (le.qiao)
* @e-mail: [email protected]
* @myblog: <a href="http://qiaolevip.iteye.com">http://qiaolevip.iteye.com</a>
* @date: 2014-8-1
*
*/
public class Test {
public static void main(String[] args) {
WeatherWebService webService = new WeatherWebServiceLocator();
try {
WeatherWebServiceSoap soapService = webService.getWeatherWebServiceSoap();
String[] response = soapService.getSupportProvince();
for (String province : response) {
System.out.println(province);
}
response = soapService.getSupportCity("上海");
for (String city : response) {
System.out.println(city);
}
response = soapService.getWeatherbyCityName("上海");
for (String city : response) {
System.out.println(city);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
上一篇: 各个操作系统的user-agent
下一篇: 异步 PHP实现异步调用方法研究与分享