Exemplo n.º 1
0
        public RssResponse Load(string url)
        {
            RssResponse result    = null;
            string      wResponse = null;

            try
            {
                ServiceClient client = new ServiceClient();
                wResponse = client.GetResponse(url);
            }
            catch (Exception)
            {
            }

            if (!string.IsNullOrEmpty(wResponse))
            {
#if DEBUG
                _logger.Info(string.Format("RSS RESPONSE from {0}: {1}", url, wResponse));
#endif
                if (!TryConvert(wResponse, ref result))
                {
                    TryConvert(RemoveEcnlosures(wResponse), ref result);
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool TryConvert(string webResponse, ref RssResponse rssResponse)
        {
            bool result = true;

            try
            {
                rssResponse = XmlHelpers.ConvertStringToXMLObject(typeof(RssResponse), webResponse) as RssResponse;
            }
            catch (Exception)
            {
                result = false;
            }

            return(result);
        }