WCF Service with WS-Security requires Signed Timestamp only

前端 未结 4 512
清歌不尽
清歌不尽 2021-02-08 21:02

I need to provide a service to a third-party that will be sending soap messages with a signed Timestamp.

How can I configure my service to support this?

4条回答
  •  一向
    一向 (楼主)
    2021-02-08 21:24

    You can do this with message contracts, see: http://msdn.microsoft.com/en-us/library/ms730255.aspx

    Here is an example from the above link:

    [MessageContract]
    public class PatientRecord 
    {
       [MessageHeader(ProtectionLevel=None)] public int recordID;
       [MessageHeader(ProtectionLevel=Sign)] public string patientName;
       [MessageHeader(ProtectionLevel=EncryptAndSign)] public string SSN;
       [MessageBodyMember(ProtectionLevel=None)] public string comments;
       [MessageBodyMember(ProtectionLevel=Sign)] public string diagnosis;
       [MessageBodyMember(ProtectionLevel=EncryptAndSign)] public string medicalHistory;
    }
    

    Note the protection levels None, Sign, EncryptAndSign

提交回复
热议问题