Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. binding = new BasicHttpBinding()
  2. {
  3. Name = "myBasicBinding",
  4. Security = new BasicHttpSecurity()
  5. {
  6. Transport = new HttpTransportSecurity()
  7. {
  8. ClientCredentialType = HttpClientCredentialType.Certificate,
  9. Realm = "Basic",
  10. },
  11. Message = new BasicHttpMessageSecurity()
  12. {
  13. ClientCredentialType = BasicHttpMessageCredentialType.UserName,
  14. },
  15. Mode = BasicHttpSecurityMode.TransportWithMessageCredential,
  16.  
  17. },
  18. MaxReceivedMessageSize = Int32.MaxValue,
  19. };
  20.  
  21. obj.ClientCredentials.ClientCertificate.Certificate = this.certificateLoader.ClientCertificate;
  22. obj.ClientCredentials.UserName.UserName = Config.Service_user;
  23. obj.ClientCredentials.UserName.Password = Config.Service_pass;
  24.  
  25. The HTTP request is unauthorized with client authentication scheme 'Anonymous'.
  26. The authentication header received from the server was 'Basic realm="Restricted"
  27.  
  28. <customBinding>
  29. <binding name="customBinding">
  30. <textMessageEncoding messageVersion="Soap11"/>
  31. <httpsTransport useDefaultWebProxy="false"
  32. requireClientCertificate="true"
  33. authenticationScheme="Basic"
  34. maxReceivedMessageSize="2147483647" />
  35. </binding>
  36. </customBinding>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement