Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maintaining credentials for wcf binding over the life of my app
- public class ProxyGenerator
- {
- public string username;
- public SecureString password;
- public string endpoint;
- private TestingService.ServiceClient _proxy = null;
- public ProxyGenerator(string uname, SecureString pword)
- {
- username = uname;
- password = pword;
- endpoint = "insert endpoint here"
- }
- public TestingService.ServiceClient GetProxy()
- {
- _proxy = new ServiceClient(endpoint);
- _proxy.ClientCredentials.UserName.UserName = username;
- _proxy.ClientCredentials.UserName.Password = password;
- return _proxy;
- }
- }
Add Comment
Please, Sign In to add comment