在 Web 服务 (WSE) 中公开自定义类型(类)

发布于 2024-07-15 12:25:33 字数 111 浏览 12 评论 0原文

如果我的 Web 服务中有自定义类型(类),我是否必须使用特殊属性进行标记,以便它们能够正确序列化?

即[某些属性]?

更新 我现在正在使用 WSE

If I have custom types (classes) in my web service, do I have to mark with with special attributes so they are serialized properly?

i.e. [SomeAttribute] ?

Update
I am using WSE at the moment

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

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

发布评论

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

评论(2

勿挽旧人 2024-07-22 12:25:33

如果您默认使用数据契约序列化程序,则不会对任何内容进行序列化 - 这与旧的 XmlSerializer 相反 - 这是旧的 asmx Web 服务方法。

对于 WCF,首先查看 DataContractAttribute:链接文本< /a>

If you are using the Data Contract serializer by default nothing is serialized - this is the opposite of the older XmlSerializer - which is the older asmx web service approach.

For WCF look at the DataContractAttribute for starters: link text

过期以后 2024-07-22 12:25:33

过时的 WSE 使用 XmlSerializer。 它应该序列化具有默认构造函数的类型的大多数公共读/写属性。 有关更多详细信息,请查找 XmlSerializer。

并尽快从 WSE 转换为 WCF,因为 WSE 已过时。

The obsolete WSE uses the XmlSerializer. It should serialize most public read/write properties of types that have a default constructor. For more details, look up XmlSerializer.

And convert from WSE to WCF as soon as possible, as WSE is obsolete.

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