/// <summary> /// Initialize the client and server and build the transport tunnel between client and server. /// </summary> private void InitializeRPC() { string serverName = Common.GetConfigurationPropertyValue("SutComputerName", this.site); string userName = Common.GetConfigurationPropertyValue("AdminUserName", this.site); string domainName = Common.GetConfigurationPropertyValue("Domain", this.site); string password = Common.GetConfigurationPropertyValue("AdminUserPassword", this.site); // Create identity for the user to connect to the server. OxnspiInterop.CreateIdentity( domainName, userName, password); MapiContext rpcContext = MapiContext.GetDefaultRpcContext(this.site); // Create Service Principal Name (SPN) string for the user to connect to the server. string userSpn = string.Empty; userSpn = Regex.Replace(rpcContext.SpnFormat, @"\[ServerName\]", serverName, RegexOptions.IgnoreCase); // Bind the client to RPC server. uint status = OxnspiInterop.BindToServer(serverName, rpcContext.AuthenLevel, rpcContext.AuthenService, rpcContext.TransportSequence, rpcContext.RpchUseSsl, rpcContext.RpchAuthScheme, userSpn, null, rpcContext.SetUuid); this.site.Assert.AreEqual <uint>(0, status, "Create binding handle with server {0} should success!", serverName); this.rpcBinding = OxnspiInterop.GetBindHandle(); this.site.Assert.AreNotEqual <IntPtr>(IntPtr.Zero, this.rpcBinding, "A valid RPC Binding handle is needed!"); }
/// <summary> /// Initialize class /// </summary> /// <param name="testSite">The instance of the ITestSite</param> public override void Initialize(ITestSite testSite) { base.Initialize(testSite); Site.DefaultProtocolDocShortName = "MS-OXCSTOR"; Common.MergeConfiguration(testSite); this.oxcropsClient = new OxcropsClient(MapiContext.GetDefaultRpcContext(this.Site)); }
/// <summary> /// Initialize the adapter. /// </summary> /// <param name="testSite">Test site.</param> public override void Initialize(ITestSite testSite) { base.Initialize(testSite); Site.DefaultProtocolDocShortName = "MS-OXCROPS"; if (!commonConfigImported) { Common.MergeConfiguration(this.Site); commonConfigImported = true; } // Initialize OxcropsClient instance. this.oxcropsClient = new OxcropsClient(MapiContext.GetDefaultRpcContext(this.Site)); }
/// <summary> /// Initialize the adapter. /// </summary> /// <param name="testSite">Test site.</param> public override void Initialize(ITestSite testSite) { base.Initialize(testSite); testSite.DefaultProtocolDocShortName = "MS-OXCNOTIF"; if (!commonConfigImported) { Common.MergeConfiguration(this.Site); commonConfigImported = true; } this.oxcRopsRegister = new OxcropsClient(MapiContext.GetDefaultRpcContext(this.Site)); this.oxcRopsTrigger = new OxcropsClient(MapiContext.GetDefaultRpcContext(this.Site)); this.oxcRopsClient = this.oxcRopsTrigger; }