加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

免费的天气预报webservice接口

发布时间:2020-12-17 00:06:36 所属栏目:安全 来源:网络整理
导读:1. http://www.ayandy.com/Service.asmx?wsdl ? 官网:http://www.ayandy.com ? 2. http://www.webservicex.net/globalweather.asmx?wsdl (英文的) example:http://www.webservicex.net/globalweather.asmx/GetWeather?CityName=dalianCountryName=china ?

1. http://www.ayandy.com/Service.asmx?wsdl

?官网:http://www.ayandy.com

?

2. http://www.webservicex.net/globalweather.asmx?wsdl(英文的)

example:http://www.webservicex.net/globalweather.asmx/GetWeather?CityName=dalian&CountryName=china

?

3. http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl

网站:http://www.webxml.com.cn/zh_cn/index.aspx?,此网站提供各种webservice接口;

java程序:

???public class WeatherUtil {??
??? private static String SERVICES_HOST = "www.webxml.com.cn";??
??? private static String WEATHER_SERVICES_URL = "http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx/";??
??? private static String PROVINCE_CODE_URL = WEATHER_SERVICES_URL???
????????????????????????????????????????????? + "getRegionProvince";??
??? private static String CITY_CODE_URL = WEATHER_SERVICES_URL??
????????????????????????????????????????? + "getSupportCityString?theRegionCode=";??
??? private static String WEATHER_QUERY_URL = WEATHER_SERVICES_URL??
????????????????????????????????????????????? + "getWeather?theUserID=&theCityCode=";??
??????
??????
??? private WeatherUtil(){}??
??????
??? public static void main(String[] args) throws Exception{??????
??????? int provinceCode = getProvinceCode("辽宁");??? //3119??
??????? int cityCode = getCityCode(provinceCode,"大连");??? //974??
??????? List weatherList = getWeather(cityCode);??
??????? for(String weather:weatherList){??
??????

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读