I am trying to configure my WCF client to create a SOAP 1.1 request that includes WS-Addressing, WS-Security, and TLS.
Security requirements are that the message includes a username token, TimeStamp, and that TimeStamp is signed using the included BinarySecurityToken.
I used the example from the following to create a WCF client binding. I changed the example a bit (see below), so that HTTPS is used as a transport mechanism, and MessageSecurity is based on UserOverTransport.
HttpsTransportBindingElement httpsTransport = new HttpsTransportBindingElement();
TransportSecurityBindingElement messageSecurity = SecurityBindingElement.CreateUserNameOverTransportBindingElement();
X509SecurityTokenParameters clientX509SupportingTokenParameters = new X509SecurityTokenParameters();
clientX509SupportingTokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToRecipient;
clientX509SupportingTokenParameters.RequireDerivedKeys = false;
messageSecurity.EndpointSupportingTokenParameters.Endorsing.Add(clientX509SupportingTokenParameters);
return new CustomBinding(messageSecurity, httpsTransport);
The SOAP messages generated by this client are very close to the requirements of the service I call, the only problem is that wsa: To signs as well as the TimeStamp address.
, WCF ? TimeStamp.