WCF中的消息包装是什么

发布于 2024-07-25 09:34:33 字数 181 浏览 2 评论 0原文

在 WCF 消息合约中,我们有 IsWrapped 属性和wrappername、wrappernamespace 属性

  • 问题?

    1. 什么是消息包装
    2. 包装消息有哪些优点
    3. 包装消息是否安全。

In WCF Messsage contract we have IsWrapped atribute and wrappername, wrappernamespace attribute

  • Question?

    1. What is Message wrapping
    2. What are the advantages of wrapping messages
    3. Is it secure to wrap the messages.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦与时光遇 2024-08-01 09:34:34

MSDN 上有一篇讨论消息协定类的 文章。 它写道

MessageContractAttribute 有一个名为 IsWrapped 的属性,指示是否应包装数据协定。 当 IsWrapped 设置为 false 时,服务合约使用的数据合约将不会被包装。 当该值设置为 true 时,数据契约将被包装; 此外,当 IsWrapped 设置为 true 时,您还可以控制包装元素使用的名称和命名空间。

WrapperName 和 WrapperNamespace 定义消息将用什么元素包装。

为了将其放在上下文中,消息协定类可以在两种情况下使用:当您使用消息类型或为服务协定所使用的数据协定使用不同的命名空间时,可以使用它。

根据此描述,它似乎对安全性没有影响。

Theres an Article on the MSDN that discusses message contract classes. It writes

The MessageContractAttribute has an attribute named IsWrapped that indicates whether the data contracts should be wrapped. When IsWrapped is set to false, the data contracts used by a service contract will not be wrapped. When this value is set to true, the data contracts will be wrapped; in addition, you can also control the name and namespace used for the wrapper element when IsWrapped is set to true.

WrapperName and WrapperNamespace define what element the message will be wrapped with.

To put this into context, a message contract class can be used in two cases: it can be used when you use message types or when you use different namespaces for the data contracts that are used by the service contract.

Based on this description, it doesn't appear to have an effect on security.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文