public string getWeather(string zip) { WeatherS.ServiceReference1.WeatherSoapClient w = new WeatherS.ServiceReference1.WeatherSoapClient(); //var v=w.GetCityForecastByZIP(TextBox1.Text); XmlDocument xmlDoc = new XmlDocument(); ForecastReturn fr = w.GetCityForecastByZIP(zip); string s = ""; for (int i = 0; i < fr.ForecastResult.Length; i++) { s += "Date " + fr.ForecastResult.ElementAt(i).Date.ToString() + "<br/>"; s += "weatherID " + fr.ForecastResult.ElementAt(i).WeatherID.ToString() + "<br/>"; s += "Description " + fr.ForecastResult.ElementAt(i).Desciption.ToString() + "<br/>"; s += "Temperatures" + " Morning Low " + fr.ForecastResult.ElementAt(i).Temperatures.MorningLow.ToString() + "\t" + "Daytime High " + fr.ForecastResult.ElementAt(i).Temperatures.DaytimeHigh.ToString() + "<br/>"; s += "Probability of Precipitation " + "Nighttime " + fr.ForecastResult.ElementAt(i).ProbabilityOfPrecipiation.Nighttime.ToString() + "\t" + " Daytime " + fr.ForecastResult.ElementAt(i).ProbabilityOfPrecipiation.Daytime.ToString() + "<br/>"; } string s1 = "State= " + fr.State + "\n" + "City= " + fr.City + "\n" + "Weather Station City=" + fr.WeatherStationCity + "\n" + s; return s1; }
public string getWeather(string zip) { WeatherS.ServiceReference1.WeatherSoapClient w = new WeatherS.ServiceReference1.WeatherSoapClient(); //var v=w.GetCityForecastByZIP(TextBox1.Text); XmlDocument xmlDoc = new XmlDocument(); ForecastReturn fr = w.GetCityForecastByZIP(zip); string s = ""; for (int i = 0; i < fr.ForecastResult.Length; i++) { s += "Date " + fr.ForecastResult.ElementAt(i).Date.ToString() + "<br/>"; s += "weatherID " + fr.ForecastResult.ElementAt(i).WeatherID.ToString() + "<br/>"; s += "Description " + fr.ForecastResult.ElementAt(i).Desciption.ToString() + "<br/>"; s += "Temperatures" + " Morning Low " + fr.ForecastResult.ElementAt(i).Temperatures.MorningLow.ToString() + "\t" + "Daytime High " + fr.ForecastResult.ElementAt(i).Temperatures.DaytimeHigh.ToString() + "<br/>"; s += "Probability of Precipitation " + "Nighttime " + fr.ForecastResult.ElementAt(i).ProbabilityOfPrecipiation.Nighttime.ToString() + "\t" + " Daytime " + fr.ForecastResult.ElementAt(i).ProbabilityOfPrecipiation.Daytime.ToString() + "<br/>"; } string s1 = "State= " + fr.State + "\n" + "City= " + fr.City + "\n" + "Weather Station City=" + fr.WeatherStationCity + "\n" + s; return(s1); }