天气预报webservice接口

对项目添加web引用

http://webservice.36wu.com/weatherService.asmx

页面中引用命名空间

protected void Button1_Click(object sender, EventArgs e)
{
WeatherService weatherService = new WeatherService();
//返回内置实体City:城市,Cityid:城市Id(查询结果异常时“False”),Temp1~Temp6:六天的气温,Weather1~Weather6:六天的天气,Wind1~Wind6:六天的风向,Fl1~Fl6:六天的风力,Img1~Img12:六天天气图片
MoreWeathe moreWeathe = weatherService.getMoreWeatherByCityName(TextBox1.Text);
List<MoreWeathe> list = new List<MoreWeathe>();
list.Add(moreWeathe);
//将接果绑定在gridView上
GridView1.DataSource = list;
GridView1.DataBind();
}

天气预报webservice接口_第1张图片

图标下载地址http://webservice.36wu.com/weather/images.rar

你可能感兴趣的:(webservice)