namespace WeatherService
{
class WeatherServer : Interface
{
public string[]GetSupportCity(string proviceName){
//获取服务对象 调用网站提供的方法
Weather.WeatherWebService service = new Weather.WeatherWebService();return service.getSupportCity(proviceName);}
public string[]GetSupportProvince(){
Weather.WeatherWebService service = new Weather.WeatherWebService();return service.getSupportProvince();}
public string[]GetWeatherbyCityName(string cityname){
Weather.WeatherWebService service = new Weather.WeatherWebService();
string[] s = new string[23];
s = service.getWeatherbyCityName(cityname);return s;}}
创建界面
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ServiceModel;
using System.Security.Policy;
namespace WeatherService
{
/// <summary>