为什么 .aspx 页面中的 WebMethod 忽略 DataContract - DataMember 属性

发布于 2024-08-06 07:56:16 字数 103 浏览 3 评论 0原文

当我发回一个类时,它会忽略 DataContract - DataMember 属性并序列化该类的所有成员,并在“__type”标志中发送类名。我怎样才能让它尊重 DataMember 属性?

When I send back a Class, it ignores the DataContract - DataMember attributes and serializes all members of the class as well as sends the class name in the "__type" flag as well. How can I make it respect the DataMember attributes?

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

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

发布评论

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

评论(1

夏有森光若流苏 2024-08-13 07:56:16

WebMethods 使用传统的“ASMX Web 服务”技术。 DataContract 是 WCF 的一部分。

它们是完全不相关的技术。

WebMethods use the legacy "ASMX Web Service" technology. DataContract is part of WCF.

They are totally unrelated technologies.

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