예제 #1
0
        private string GetNextPagingUrl(string responseFeed)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(responseFeed);

            XmlNamespaceManager nsmgr = NameSpaceHelper.CreateNamespaceManager(xmlDocument.NameTable);

            XmlElement xmlNode = (XmlElement)xmlDocument.DocumentElement.SelectSingleNode("atom:link[@rel='next']", nsmgr);

            if (null == xmlNode)
            {
                return(null);
            }

            if (!xmlNode.HasAttribute("href"))
            {
                return(null);
            }

            string href = xmlNode.Attributes["href"].Value;

            if (string.IsNullOrEmpty(href))
            {
                return(null);
            }

            return(href);


            //return xmlDocument.SelectSingleNode("/sdata:tracking/sdata:pollingMillis", nsmgr).InnerText;
        }
예제 #2
0
        private int GetPollingMillis(string responseFeed)
        {
            try
            {
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.LoadXml(responseFeed);

                XmlNamespaceManager nsmgr = NameSpaceHelper.CreateNamespaceManager(xmlDocument.NameTable);
                int pollingMillis         = int.Parse(xmlDocument.SelectSingleNode("/sdata:tracking/sdata:pollingMillis", nsmgr).InnerText);

                if (pollingMillis <= 0)
                {
                    return(1000);
                }

                return(pollingMillis);
            }
            catch
            {
                return(1000);
            }
        }