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);
}
[…] Securing the Web Services: It is difficult to secure a web service that cross the security domains. We can secure a web service by sending over secure transport, such as Secure Socket Layer(SSL) but that holds good when the communication is point-to-point. Some times SOAP message has to be routed to so many intermediaries before reaching the receiver. We can address this problem by Adding Security Credentials to SOAP Message.Alternatively we can digitalsign a SOAP Message using WSE. […]
Digital signing the SOAP message…
You’ve been kicked (a good thing) – Trackback from DotNetKicks.com…