调用天气Web Service
            i.创建项目
                项目名称:weatherclient
            ii.创建本地的wsdl文件
                文件名称:weather.wsdl
                访问:http://www.webservicex.net/globalweather.asmx?wsdl会看到文件,然后查看源码
                保存到本地。                
            iii.根据本地的wsdl文件生成调用服务端的代码
                使用wsimport -target 2.0 -keep 本地wsdl文件路径
            iv.调用
                包名:net.webservicex.client
                类名:WeatherClientTest.java
                类内容:
                public class WeatherClientTest {
                    public static void main(String[] args) {
                        GlobalWeather globalWeather = new GlobalWeather();
                        GlobalWeatherSoap gws = globalWeather.getGlobalWeatherSoap();
                        String result = gws.getWeather("shanghai", "china");
                        System.out.println(result);
                    }
                }

QQ截图20181015143452.png