zoukankan      html  css  js  c++  java
  • WebService简单使用教程

    根据说明书获取信息

    代码示例:

     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 }
  • 相关阅读:
    Memcached安装
    linux 安装telnet
    varnish应用
    linux 安装apache
    varnishlog、Varnishstat详解
    varnish CLI管理
    varnish 子程序流程
    python3 cms识别类
    python3 fofa爬取类
    每日健康打卡
  • 原文地址:https://www.cnblogs.com/116970u/p/11100324.html
Copyright © 2011-2022 走看看