从真实对象创建 ASMX 存根对象的实例

发布于 2024-08-04 15:04:10 字数 127 浏览 1 评论 0原文

我有一个公开多个对象的 ASMX Web 服务。我有该对象的真实实例,并且我想实例化从中填充的存根对象。显然,这样的功能已经存在,因为当 Web 服务返回一个值时,它会创建存根并填充它。我只需要手动做同样的事情。

有想法吗?

I have an ASMX web service that exposes several objects. I have a real instance of that object, and I would like to instantiate a stub object that is populated from it. Clearly there is such functionality already, because when the web service returns a value it is creating the stub and populating it. I just need to do the same thing manually.

Ideas?

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

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

发布评论

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

评论(1

喵星人汪星人 2024-08-11 15:04:10

你说

Web 服务返回一个值,它正在创建存根并填充它

但事实并非如此。 Web 服务使用 XML Serializer 将对象序列化为 SOAP 消息,然后将其发送到客户端。在客户端,SOAP 被反序列化回一个对象,尽管这次它是一个代理对象。

You said

the web service returns a value it is creating the stub and populating it

This is not true. The web service uses the XML Serializer to serialize the object into a SOAP message, then sends it to the client. At the client side, the SOAP is deserialized back into an object, though this time, it's a proxy object.

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