public string[] WeatherService(string zip) { Webweather.ForecastReturn forecasts = new Webweather.ForecastReturn(); Webweather.Weather forecast = new Webweather.Weather(); Webweather.Forecast[] weatherData; string[] result = new string[6]; forecasts = forecast.GetCityForecastByZIP(zip); //this method will return class as ForecastReturn if (forecasts.ForecastResult != null) //Forecase[] set { weatherData = forecasts.ForecastResult; result[0] = forecasts.City + "," + forecasts.State; //location for (int i = 0; i < 5; i++) { result[i + 1] = "Day" + (i + 1) + " Description:" + weatherData[i].Desciption + " LowTemp:" + weatherData[i].Temperatures.MorningLow + " HighTemp:" + weatherData[i].Temperatures.DaytimeHigh; } } else { return(null); } return(result); }
public string[] WeatherService(string zip) { Webweather.ForecastReturn forecasts = new Webweather.ForecastReturn(); Webweather.Weather forecast = new Webweather.Weather(); Webweather.Forecast[] weatherData; string[] result = new string[6]; forecasts = forecast.GetCityForecastByZIP(zip); //this method will return class as ForecastReturn if (forecasts.ForecastResult != null) //Forecase[] set { weatherData = forecasts.ForecastResult; result[0] = forecasts.City + "," + forecasts.State; //location for (int i = 0; i < 5; i++) { result[i + 1] ="Day"+(i+1)+ " Description:" + weatherData[i].Desciption + " LowTemp:" + weatherData[i].Temperatures.MorningLow + " HighTemp:" + weatherData[i].Temperatures.DaytimeHigh; } } else { return null; } return result; }