Created
November 4, 2015 10:29
-
-
Save anonymous/7a7ec32f2ce5cdfd0368 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EndpointAddress endpoint = new EndpointAddress("endpoint"); | |
CustomBinding binding = new CustomBinding(); | |
var security = TransportSecurityBindingElement.CreateUserNameOverTransportBindingElement(); | |
security.IncludeTimestamp = false; | |
security.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic256; | |
security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; | |
var encoding = new TextMessageEncodingBindingElement(); | |
encoding.MessageVersion = MessageVersion.Soap11; | |
var transport = new HttpsTransportBindingElement(); | |
transport.MaxReceivedMessageSize = 20000000; | |
binding.Elements.Add(security); | |
binding.Elements.Add(encoding); | |
binding.Elements.Add(transport); | |
webservice service = new webservice(binding, endpoint); | |
cient.ClientCredentials.UserName.UserName = "user"; | |
cient.ClientCredentials.UserName.Password = "pass"; | |
cient.ClientCredentials.HttpDigest.ClientCredential.UserName = "user"; | |
cient.ClientCredentials.HttpDigest.ClientCredential.Password = "pass"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment