Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <bindings>
  2. <customBinding>
  3. <binding name="Example_TestBinding">
  4. <security defaultAlgorithmSuite="TripleDesRsa15"
  5. authenticationMode="MutualCertificate"
  6. requireDerivedKeys="false"
  7. includeTimestamp="false"
  8. messageProtectionOrder="SignBeforeEncrypt"
  9. messageSecurityVersion="WSSecurity10WSTrust13WSSecureConversation13WSSecurityPolicy12BasicSecurityProfile10"
  10. requireSignatureConfirmation="false">
  11. <localClientSettings detectReplays="true"/>
  12. <localServiceSettings detectReplays="true"/>
  13. </security>
  14. <textMessageEncoding messageVersion="Soap11"/>
  15. <httpsTransport authenticationScheme="Basic" manualAddressing="false" maxReceivedMessageSize="524288000" transferMode="Buffered"/>
  16. </binding>
  17. </customBinding>
  18. </bindings>
  19. <client>
  20. <endpoint
  21. address="https://blabla.hana.ondemand.com/Example_Test"
  22. binding="customBinding"
  23. bindingConfiguration="Example_TestBinding"
  24. contract="WebServiceTest.Example_Test"
  25. name="Example_Test"
  26. />
  27. </client>
  28.  
  29. var client = new Example_TestClient();
  30. client.ClientCredentials.UserName.UserName = "user";
  31. client.ClientCredentials.UserName.Password = "pass";
  32.  
  33. X509Certificate2 certClient = new X509Certificate2(certClientPath, certClientPassword);
  34. client.ClientCredentials.ClientCertificate.Certificate = certClient;
  35.  
  36. X509Certificate2 certService= new X509Certificate2(certServicePath);
  37. client.ClientCredentials.ServiceCertificate.DefaultCertificate = certService;
  38.  
  39. var response = client.Example_Test(requestObj);
  40.  
  41. "The EncryptedKey clause was not wrapped with the required
  42. encryption token 'System.IdentityModel.Tokens.X509SecurityToken'."
  43. at System.ServiceModel.Security.WSSecurityJan2004.WrappedKeyTokenEntry.CreateWrappedKeyToken(String id, String encryptionMethod, String carriedKeyName, SecurityKeyIdentifier unwrappingTokenIdentifier, Byte[] wrappedKey, SecurityTokenResolver tokenResolver)rn ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement