/// <summary> /// Get a page's worth of Subscriptions listing /// </summary> /// <param name="onlineSubscriptions"></param> /// <param name="pageToRequest">Page # we are requesting (1 based)</param> /// <param name="totalNumberPages">Total # of pages of data that Server can return us</param> private void ExecuteRequest_ForPage(List <SiteSubscription> onlineSubscriptions, int pageToRequest, out int totalNumberPages) { int pageSize = _onlineUrls.PageSize; //Create a web request, in including the users logged-in auth information in the request headers var urlQuery = _onlineUrls.Url_SubscriptionsList(_onlineSession, pageSize, pageToRequest); _onlineSession.StatusLog.AddStatus("Web request: " + urlQuery, -10); XmlDocument xmlDoc = ResourceSafe_PerformWebRequest_GetXmlDocument(urlQuery, "get subscriptions list"); //var webRequest = CreateLoggedInWebRequest(urlQuery); //webRequest.Method = "GET"; //var response = GetWebReponseLogErrors(webRequest, "get subscriptions list"); //var xmlDoc = GetWebResponseAsXml(response); //Get all the subscription nodes var nsManager = XmlHelper.CreateTableauXmlNamespaceManager("iwsOnline"); var subscriptions = xmlDoc.SelectNodes("//iwsOnline:subscription", nsManager); //Get information for each of the data sources foreach (XmlNode itemXml in subscriptions) { try { var thisSubscription = new SiteSubscription(itemXml); onlineSubscriptions.Add(thisSubscription); SanityCheckSubscription(thisSubscription, itemXml); } catch { AppDiagnostics.Assert(false, "Subscription parse error"); _onlineSession.StatusLog.AddError("Error parsing subscription: " + itemXml.OuterXml); } } //end: foreach //------------------------------------------------------------------- //Get the updated page-count //------------------------------------------------------------------- totalNumberPages = DownloadPaginationHelper.GetNumberOfPagesFromPagination( xmlDoc.SelectSingleNode("//iwsOnline:pagination", nsManager), pageSize); }