Guest User

Untitled

a guest
Aug 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. WCF Security exception when calling from Windows Service
  2. BasicHttpBinding httpBinding = new BasicHttpBinding();
  3. httpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
  4. httpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
  5. httpBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
  6. httpBinding.Security.Transport.Realm = service_realm;
  7.  
  8. EndpointAddress address = new EndpointAddress(service_address);
  9.  
  10. Service.ServiceClient client = new Service.ServiceClient(httpBinding, address);
  11.  
  12. client.ClientCredentials.UserName.UserName = service_username;
  13. client.ClientCredentials.UserName.Password = service_password;
Add Comment
Please, Sign In to add comment