public void TestGetEmployeeWithClientCredentials() { var serviceClient = new ServicePoxry.AWServiceReference.EmployeeBoServiceClient(); ///http://stackoverflow.com/questions/4256520/wcf-error-the-x-509-certificate-cn-localhost-chain-building-failed serviceClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; serviceClient.ClientCredentials.UserName.UserName = "******"; serviceClient.ClientCredentials.UserName.Password = "******"; var entity=serviceClient.GetEmployee(1); Assert.NotNull(entity); }
public void TestGetEmployeeWithClientCredentials() { var serviceClient = new ServicePoxry.AWServiceReference.EmployeeBoServiceClient(); ///http://stackoverflow.com/questions/4256520/wcf-error-the-x-509-certificate-cn-localhost-chain-building-failed serviceClient.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; serviceClient.ClientCredentials.UserName.UserName = "******"; serviceClient.ClientCredentials.UserName.Password = "******"; var entity = serviceClient.GetEmployee(1); Assert.NotNull(entity); }