We can add Message header to WCF message by adding MessageHeader attribute like this
[MessageContract]
public class HelloResponseMessage
{
[MessageHeader(ProtectionLevel=EncryptAndSign)]
public string SSN
{
get { return extra; }
set { this.extra = value; }
}
}
First question is, how secure is this, and is this working for all type of WCF bindings?
and the second question, is it possible to add encrypted header to all messages and extract in server part dynamical like this?
MessageHeader header = MessageHeader.CreateHeader("SessionKey", "ns", _key);
OperationContext.Current.OutgoingMessageHeaders.Add(header);