8

I am creating a WCF webservice whose requests/responses are supposed to be signed only. For this, on ServiceContract attribute I have set

ProtectionLevel = ProtectionLevel.Sign

That works ok.

Due to requirements some SoapFaults are supposed to be thrown from service; two types of SoapFaults:

  • related to application
  • related to WS-Addressing (e.g. MessageID is missing)

For this I am using the normal of approach of dealing with SoafFaults: create an IErrorHandler in which a Message instance is created with MessageFault.CreateFault.

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

John Saunders
  • 160,644
  • 26
  • 247
  • 397
csg
  • 2,047
  • 2
  • 22
  • 35

1 Answers1

0

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 enables security and you do not set the ProtectionLevel property anywhere on the contract, all application data will be encrypted and signed.

I guess that the build in types by default use this behaviour. You can verify this by looking at which exception is actually thrown.

Luuk
  • 1,959
  • 1
  • 21
  • 43
  • The protection level is set at the contract level with: [ServiceContract(ProtectionLevel = ProtectionLevel.Sign)] – csg Jan 30 '13 at 23:56