nodots
nodots

Reputation: 1490

How to encrypt WS-Addressing headers

Scenario: I am writing a WCF client to access a Java/Metro webservice which requires several SOAP headers to be signed and encrypted:

<wsp:Policy>
  <wsp:ExactlyOne>
    <wsp:All>
      <sp:SignedParts>
        <sp:Body/>
        <sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
        <sp:Header Namespace="... application specific headers ..."/>
      </sp:SignedParts>
      <sp:EncryptedParts>
        <sp:Header Namespace="http://www.w3.org/2005/08/addressing"/>
        <sp:Header Namespace="... application specific headers ..."/>
      </sp:EncryptedParts>
    </wsp:All>
  </wsp:ExactlyOne>
</wsp:Policy>

It works for the application specific headers (the ProtectionLevel attribute is applied on the respective proxy type members). The WS-Addressing headers, however, are signed but not encrypted.

I tried to add them programmatically to the ChannelProtectionRequirements message parts collection(s) through contract or endpoint behaviors (e.g. like described here). No success.

Any ideas how to do this?

Upvotes: 2

Views: 515

Answers (1)

nodots
nodots

Reputation: 1490

Ok, sackcloth & ashes coming up. I'm not sure what went wrong in my tests, but it does work when I add the respective headers to the IncomingSignatureParts and IncomingEncryptionParts of the service endpoint through a contract behavior.

Upvotes: 1

Related Questions