为什么 .aspx 页面中的 WebMethod 忽略 DataContract - DataMember 属性
当我发回一个类时,它会忽略 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WebMethods 使用传统的“ASMX Web 服务”技术。 DataContract 是 WCF 的一部分。
它们是完全不相关的技术。
WebMethods use the legacy "ASMX Web Service" technology. DataContract is part of WCF.
They are totally unrelated technologies.