Guest User

Untitled

a guest
Jul 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. LocalService
  2. LocalSystem
  3. NetworkService
  4. ApplicationPoolIdentity
  5.  
  6. Public Class ServiceCall
  7.  
  8. Private _binding As BasicHttpBinding
  9. Private _endPoint As EndpointAddress
  10.  
  11.  
  12. Public Sub New()
  13. _binding = New BasicHttpBinding()
  14. _binding.Security.Mode = BasicHttpSecurityMode.Transport
  15. _binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate
  16.  
  17. End Sub
  18.  
  19.  
  20. Public Sub Connect()
  21.  
  22.  
  23. _endPoint = New EndpointAddress("https://www.theirhostname.com/WebServices/Test")
  24.  
  25. Dim client As New TestServiceClient(_binding, _endPoint)
  26. client.ClientCredentials.ClientCertificate.SetCertificate(
  27. StoreLocation.LocalMachine,
  28. StoreName.My,
  29. X509FindType.FindBySubjectName,
  30. "ServiceEndPoint- Testing")
Add Comment
Please, Sign In to add comment