Why are WCF SoapFault responses encrypted in some situations?

I am creating a WCF web service whose requests / responses should only be signed. For this, in the ServiceContract attribute, I set

ProtectionLevel = ProtectionLevel.Sign 

This is working fine.

Due to the requirements, it is assumed that some SoapFaults will be reset from the service; Two types of SoapFaults:

  • associated with the application
  • associated with WS-Addressing (e.g. no MessageID)

To do this, I use the usual approach to working with SoafFaults: create an IErrorHandler in which an instance of Message is created with MessageFault.CreateFault.

Almost all returned SoapFaults are not encrypted (this is normal for me), my question is why those with action = "http://www.w3.org/2005/08/addressing/fault" or " http: // www. w3.org/2005/08/addressing/soap/fault "encrypted?

+8
web-services wcf soapfault
source share
1 answer

Check out http://msdn.microsoft.com/en-us/library/aa347791.aspx and http://msdn.microsoft.com/en-us/library/system.servicemodel.faultcontractattribute.aspx , It states that

If you select a binding that provides security and you do not set the ProtectionLevel Property anywhere in the contract, all application data will be encrypted and signed.

I assume that type building uses this behavior by default. You can verify this by looking at which exception is actually thrown.

0
source share

All Articles