using System; using System.ServiceModel; namespace HeuristicLab.OKB.Client { public class ClientFactory { public static T Create() where T : ClientBase, I where I : class { var client = Activator.CreateInstance(); client.ClientCredentials.UserName.UserName = "swagner"; client.ClientCredentials.UserName.Password = "swagner"; client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None; return client; } } }