Introduction

When using the WS-Security in WCF the default behavior is to both sign and encrypt the SOAP request but sometimes the enncryption of SOAP request is not required by the destination web service to disable the encyption you can use this behavior.

I came across a requirement where destination service doe's need the encrypted SOAP request but it must be signed.

Build the Sample

- Build the code and install the assembly WCF.Behavior.SignSoapRequest.dll to GAC.

- Update the machine.config and add the following element to section

<behaviorExtensions>
    <add name="SignSoapRequestBehavior" type="WCF.Behavior.SignSoapRequest.SignSoapRequestBehaviorExtensionElement, WCF.Behavior.SignSoapRequest, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba7175b2b6205a29" />

 
Note: Update the PublicKeyToken as per the key used to create the strong name for the assembly.

Follow the steps to send signed SOAP messages

For more details refer to the following posts:

Send signed and encrypted SOAP request in BizTalk Server using WS-Security

 

Send signed SOAP request without encrypting the header and body in BizTalk Server using WS-Security

About Me

Rohit C.M. Sharma

http://rohitt-sharma.blogspot.com