12.21

来源:互联网 发布:flash player 12 mac 编辑:程序博客网 时间:2024/05/25 01:36

通过今天的学习让我们掌握了Web Service基础 、创建web服务web服务发布到IIS下 电脑调用另一台电脑中的web服务(添加web引用的知识用法和类差不多:

比如:

cn.com.webxml.www.TrainTimeWebService wws = new cn.com.webxml.www.TrainTimeWebService();
        DataSet ds = new DataSet();
        ds = wws.getStationAndTimeByStationName(this.TextBox1.Text,this.TextBox2.Text,"");
        GridView1.DataSource = ds;
        this.DataBind();

 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e){
        cn.com.webxml.www.WeatherWebService wws = new cn.com.webxml.www.WeatherWebService();
        BindCity(wws);
    }
    private void BindCity(cn.com.webxml.www.WeatherWebService wws){
        this.DropDownList2.Items.Clear();
        string[] strs = wws.getSupportCity(this.DropDownList1.SelectedValue);
        foreach (string  str in strs)
            this.DropDownList2.Items.Add(new ListItem(str.Substring(0, str.IndexOf("("))));
    }

等。