public static ServiceBase <IDXVCSService> ConnectWCF(string auxPath, string user, string password) { lock (services) { WCFService <IDXVCSService> service; string serviceName = string.Format("{0}#$%%$#{1}#@%%@#{2}", auxPath, string.IsNullOrEmpty(user) ? string.Empty : user, string.IsNullOrEmpty(password)); if (!services.TryGetValue(serviceName, out service)) { EndpointAddress myEndpointAddress = new EndpointAddress(new Uri(auxPath), new SpnEndpointIdentity(String.Empty)); ServiceEndpoint point = GZipMessageEncodingBindingElement.CreateEndpoint(myEndpointAddress, typeof(IDXVCSService)); ChannelFactory <IDXVCSService> factory = new Factory <IDXVCSService>(point); factory.Credentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification; if (!string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(password)) { factory.Credentials.Windows.ClientCredential = new System.Net.NetworkCredential(user, password); } service = new WCFService <IDXVCSService>(factory); services.Add(serviceName, service); } return(service); } }
public AutoPoolInspector(WCFService <T> client) { this.client = client; }
public AutoPoolBehavior(WCFService <T> client) { this.client = client; }