The MapiHttpAdapter class contains the MAPIHTTP implements for the interfaces of IMS_OXNSPIAdapter.
Example #1
0
        public NSPIAdapter(ITestSite site)
        {
            this.site = site;
            this.originalServerName = Common.GetConfigurationPropertyValue("SutComputerName", this.site);
            this.userName           = Common.GetConfigurationPropertyValue("AdminUserName", this.site);
            this.domainName         = Common.GetConfigurationPropertyValue("Domain", this.site);
            this.password           = Common.GetConfigurationPropertyValue("AdminUserPassword", this.site);
            this.waitTime           = int.Parse(Common.GetConfigurationPropertyValue("WaitTime", this.site));
            this.maxRetryCount      = uint.Parse(Common.GetConfigurationPropertyValue("RetryCount", this.site));
            string requestURL = Common.GetConfigurationPropertyValue("AutoDiscoverUrlFormat", this.site);

            requestURL              = Regex.Replace(requestURL, @"\[ServerName\]", this.originalServerName, RegexOptions.IgnoreCase);
            this.transport          = Common.GetConfigurationPropertyValue("TransportSeq", this.site).ToLower(System.Globalization.CultureInfo.CurrentCulture);
            AdapterHelper.Transport = this.transport;
            if (this.transport == "ncacn_http" || this.transport == "ncacn_ip_tcp")
            {
                this.InitializeRPC();
                this.nspiRpcAdapter = new NspiRpcAdapter(this.site, this.rpcBinding, this.contextHandle, this.waitTime, this.maxRetryCount);
            }
            else
            {
                AdapterHelper.SessionContextCookies = new CookieCollection();
                this.autoDiscoverProperties         = AutoDiscover.GetAutoDiscoverProperties(this.site, this.originalServerName, this.userName, this.domainName, requestURL, this.transport);
                this.site.Assert.IsNotNull(this.autoDiscoverProperties.AddressBookUrl, @"The auto discover process should return the URL to be used to connect with a NSPI server through MAPI over HTTP successfully.");
                this.nspiMapiHttpAdapter = new NspiMapiHttpAdapter(this.site, this.userName, this.password, this.domainName, this.autoDiscoverProperties.AddressBookUrl);
            }
        }