Exemplo n.º 1
0
        public Weather GetCurrent(int zip)
        {
            var getWeatherRequest = new GetCityWeatherByZIPRequest
            {
                Body = new GetCityWeatherByZIPRequestBody
                {
                    ZIP = zip.ToString()
                }
            };

            try
            {
                var weatherServiceReturn = weatherSoap.GetCityWeatherByZIPAsync(getWeatherRequest).Result;
                return(new Weather
                {
                    Temperature = Convert.ToDecimal(weatherServiceReturn.Body.GetCityWeatherByZIPResult.Temperature)
                });
            }
            catch (Exception e)
            {
                throw new CommunicationException("CDYNE failed to retrieve resource", e);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Allows you to get your City's Weather, which is updated hourly. U.S. Only
 /// </summary>
 public virtual System.Threading.Tasks.Task <GetCityWeatherByZIPResponse> GetCityWeatherByZIPAsync(GetCityWeatherByZIPRequest request)
 {
     return(this.CallAsync <GetCityWeatherByZIPRequest, GetCityWeatherByZIPResponse>("http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP", request));
 }