根据说明书获取信息
代码示例:
1 import com.gyf.weather.ws.arrayofstring; 2 import com.gyf.weather.ws.WeatherWS; 3 import com.gyf.weather.ws.WeatherWSSoap; 4 5 public class Main { 6 7 public static void main(String[] args) { 8 9 //由下向上看,先找到说明书中的服务WeatherWS 10 //获取服务 11 WeatherWS ws = new WeatherWS(); 12 //获取端口 13 WeatherWSSoap soap = ws.getPort(WeatherWSSoap.class); 14 15 //1.获得国外国家名称和与之对应的ID 16 /* arrayofstring aos = soap.getRegionCountry(); 17 for (String region : aos.getString()){ 18 System.out.println(region); 19 }*/ 20 21 //2.获得支持的城市/地区名称和与之对应的ID 22 /*arrayofstring aos = soap.getSupportCityString("吉林"); 23 for (String city : aos.getString()){ 24 System.out.println(city); 25 }*/ 26 27 //3.获取天气信息 28 arrayofstring aos = soap.getWeather("吉林", ""); 29 for (String item : aos.getString()){ 30 System.out.println(item); 31 } 32 33 } 34 }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。