O'Reilly logo

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications by Steven Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Securing a dynamic SoapHeader

As described in the Adding a dynamic SoapHeader into a message recipe in Chapter 5, WCF supports dynamically adding SoapHeaders into request/response messages without defining them statically in ServiceContract or OperationContract. This works fine for those scenarios where the dynamic SoapHeader doesn't need to be secured (either signing or encrypting), since the programmatically-injected SoapHeader is transferred as unsecured in the <headers> section of a SOAP envelope. Then, how do we secure the dynamically added SoapHeader?

In this recipe, we will demonstrate how to secure a SoapHeader that is added into the WCF request message, programmatically.

How to do it...

To secure a dynamically added SoapHeader, we need to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required