Пример #1
0
        public void WanneerIngelogdDanGeenException()
        {
            callback = new ClientUpdateCallback();
            var binding = new NetTcpBinding(SecurityMode.Message);
            binding
                .Security
                .Message
                .ClientCredentialType =
                    MessageCredentialType.UserName;

            var factory = new DuplexChannelFactory<IService>(callback,
                binding,
                new EndpointAddress("net.tcp://localhost:6789"));

            factory.Credentials.UserName.UserName = "******";
            factory.Credentials.UserName.Password = "******";

            factory.Credentials.ServiceCertificate.SetDefaultCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindBySubjectName, "localhost");
            factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;

            client = factory.CreateChannel();

            client.Secure();
        }
Пример #2
0
 public void TestInit()
 {
     callback = new ClientUpdateCallback();
     var factory = new DuplexChannelFactory<IService>(callback,
         new NetNamedPipeBinding { TransactionFlow = true },
         new EndpointAddress("net.pipe://localhost/ping"));
     client = factory.CreateChannel();
 }