Exemple #1
0
        /// <summary>
        /// Connects to the sharepoint server given a name. All
        /// this does is setup the server url and get the site title
        /// through the SiteData web service.
        /// </summary>
        public void Connect()
        {
            SiteData       ws           = NewSiteDataWebService();
            _sWebMetadata  webMetadata  = null;
            _sSiteMetadata siteMetadata = null;

            _sWebWithTime[]  siteTime  = null;
            _sListWithTime[] listMData = null;
            _sFPUrl[]        urls      = null;
            string           roles;

            string[] roleUsers;
            string[] roleGroups;
            string   users;
            string   groups;

            string[] crossSiteGroups;

            siteCollection.Clear();

            try
            {
                // First grab the web metadata
                ws.GetWeb(out webMetadata, out siteTime, out listMData, out urls,
                          out roles, out roleUsers, out roleGroups);

                // All this just to get a server name but can be extended for other properties
                serverName        = webMetadata.Title;
                serverDescription = webMetadata.Description;

                // Now grab the site metadata (contains different info than the web metadata)
                ws.GetSite(out siteMetadata, out siteTime, out users, out groups,
                           out crossSiteGroups);

                // For now just set the last modified DateTime but can be expanded
                lastModified = siteMetadata.LastModified;
            }
            catch (SoapException ex)
            {
                throw ex;
            }
        }