使用消息安全性和MessageContract的wsHttpBinding [英] wsHttpBinding using Message security and MessageContract

查看:64
本文介绍了使用消息安全性和MessageContract的wsHttpBinding的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,通过WSHttpbinding,我们可以按照下面的代码片段所述设置消息级别的安全性

As per my knowledge, through WSHttpbinding we can set the message level security as mentioned in below code snippet


WSHttpBinding b = new WSHttpBinding();
b.Security.Mode = SecurityMode.Message;


推荐答案

您好,您已经发现,如果要保护零件邮件,您需要MessageContract.例如,您不想签名或加密recordID,因此可以将其ProtectionLevel配置为None.如果您只想使用一个设置 对于整个消息,您不必使用MessageContract.但也请注意,MessageContract允许您指定应在消息标题中放置哪个属性,而DataContract则不允许您这样做.
Hello, as you already discovered, if you want to protect part of the message, you need MessageContract. For example, you don't want to sign or encrypt recordID, so you configure its ProtectionLevel to None. If you simply want to use a single setting for the whole message, you don't have to use MessageContract. But also note MessageContract allows you to specify which property should be put in the message header, while DataContract doesn't allow you to do that.


这篇关于使用消息安全性和MessageContract的wsHttpBinding的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆