->new->Axis2 wizards ->Axis2 Cord Generator -> Generate java source code from WSDL file ->WSDL file local->填写 http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl-> 这里custom package name 改成 com.zyl.test 下面的http://WebXml.com.cn/也改成com.zyl.test ->output path 选你的项目 完成 package com.zyl.test; import java.rmi.RemoteException; public class TestWeather { public static void main(String[] args) throws RemoteException { WeatherWSStub weather = new WeatherWSStub(); WeatherWSStub.GetRegionCountry region_country = new WeatherWSStub.GetRegionCountry(); WeatherWSStub.ArrayOfString country = weather .getRegionCountry(region_country).localGetRegionCountryResult; String[] countries = country.localString; for (String string : countries) { System.out.println(string); String[] mycountry = string.split(","); System.out.println(mycountry[0] + ">>>>>>>" + mycountry[1]); } WeatherWSStub.GetRegionProvince region_province = new WeatherWSStub.GetRegionProvince(); WeatherWSStub.ArrayOfString province = weather .getRegionProvince(region_province).localGetRegionProvinceResult; String[] provincies = province.localString; for (String string : provincies) { System.out.println(string); } WeatherWSStub.GetSupportCityString region_city = new WeatherWSStub.GetSupportCityString(); region_city.setTheRegionCode("3114"); String[] cities = weather.getSupportCityString(region_city).localGetSupportCityStringResult.localString; for (String string : cities) { System.out.println(string); } WeatherWSStub.GetWeather city_weather = new WeatherWSStub.GetWeather(); city_weather.setTheCityCode("650"); String[] localweather = weather.getWeather(city_weather).localGetWeatherResult.localString; for (String string : localweather) { System.out.println(string); } } }
详细解决方案
Web Services查寻天气预报
热度:257 发布时间:2012-10-24 14:15:58.0
相关解决方案
- web service No services have been found.解决方法
- 郁闷啊identifier of an instance of com.services.dao.Address was altered from 44 to,该怎么解决
- 天气预报,该怎么解决
- javax.xml.soap.SOAPException: System.Web.Services.Protocols.
- 在北京,net程序员做哪方面的开发薪水最高呢?网站?Web Services、还是别的什么?解决办法
- Reporting Services 可以设立多级权限吗
- ===VS2005 Report Services 打印和导出Excel有关问题===急帮帮忙,多谢了
- Reporting Services 曲线图 怎么实现双Y轴
- reporting services 刷新有关问题
- reporting services 2005 如何定时刷新
- reporting services 怎么使用存储过程
- 急Reporting Services 2005 报表导出Excel时,行高怎么控制?
- C# windows services 使用IDictionary 有关问题?
- jquery的多功能树(单选 多选)动态加载 刷新 有关问题 ,js 天气预报 静态页面可以运行 直接拷到项目里就不运行了
- 求“天气预报”服务,温度,湿度,该怎么处理
- !怎么让windows services 在每天凌晨3点钟执行
- System.Web.Services.Protocols.SoapException: 服务器无法处理请求。 特急该如何解决
- 用ASP.NET1.1 连接microsoft online services 通过OUTLOOK来发信解决方法
- “RIA Services+linq to sql”和“Web中DAL层”解决方案
- 小弟我建立了个web services,Ctrl+F5的时候有有关问题
- web services 属于分布式对象技术吗?解决思路
- 实现BLOG WEB API 建议. XML-RPC 还是 web services?该怎么处理
- ==============ajax怎的得到Web.Services.WebService和返回值
- ?reporting services 不重新加载解决方法
- Web Services 无法写入Cookies,该怎么处理
- 在Visual studio 2005里施用的Reporting Services
- sharepoint services 3.0 安装配置有关问题
- 天气预报 webservice 查询不已天气状况
- socket形式,DCOM方式,和web services,三种方式优缺点
- socket方式,DCOM方式,和web services,三种方式优缺点,该如何处理