tags:

views:

195

answers:

0

Hallo, if have to integrate with a given Web-Service and the service has the need that the message-headers are all serialized without encryption and signature. The body of the message is split in two parts, represented by two elements one is called context and the other called data. The context-element should not be encrypted and signed, but the data element should be encrypted and signed:

The following approach does not work:

[MessageContractAttribute(WrapperName="contract", WrapperNamespace="anyNamespcae", IsWrapped=true, ProtectionLevel = ProtectionLevel.None)]
public partial class contract {

    [MessageBodyMember(Namespace="anyNamespace", Order=0, ProtectionLevel = ProtectionLevel.None)]
    public Context context;

    [MessageBodyMemberAttribute(Namespace="anyOtherNamespace", Order=1, ProtectionLevel = ProtectionLevel.EncryptAndSign)]
    public Data data;

    public contract() {
    }
}

This is in line with the documentation because the ProtectionLevel specified on a MessageBodyMember specifies the minimum required protection level for the entire body. The the above approach leads two a message body that is completly encrypted and signed.

So the question: Is there a way to state that I want the context (MessageBodyMember) to be unsigned and unencrypted and the data (MessageBodyMember) signed and encrypted do I need to do the complete message serialization using custome code?

related questions