WSE allows you to digitally sign a SOAP Messages by overriding the SecureMessage method.
To sign a SOAP message
1. The following code example overrides the SecureMessage method.
public override void SecureMessage(SoapEnvelope envelope, Security security)
{//Obtain the security token with which you want to sign the SOAP message with.
KerberosToken kerbToken = newKerberosToken("host/" + hostname + "@" + domainName);// Add the security token. security.Tokens.Add(kerbToken);// Specify the security token to sign the message with. MessageSignature sig = new MessageSignature(kerbToken);// Add the digital signature to the SOAP message. security.Elements.Add(sig);
}
Leave a Reply