当前位置:  开发笔记 > 开发工具 > 正文

强制.NET Web服务使用本地对象类,而不是代理类

如何解决《强制.NETWeb服务使用本地对象类,而不是代理类》经验,为你挑选了0个好方法。

I have a webservice that I'm calling from a windows forms application (both .NET, both in the same solution), and I'd like my webservice to return a custom object from elsewhere in the project - it's a common object that they both share a reference to, as it's in the third project in my solution. When I call the webservice, it returns a "Person" object, but it's in the namespace of the webservice, and it's created from a proxy class that the webservice itself generated. As such, I can't manipulate it and return it to my program, which is expecting a "Person" object based on the shared copy of the class, not a proxy copy from the webservice namespace, and I get an error when I try to CType it to the correct class type.

如何强制Web服务使用类的本地副本,而不是代理副本?在这种情况下,我的问题是否有意义?如果没有,我会澄清它.

值得注意的是 - 我已经使用了所有参数ByRef,并使用这些返回的值来填充我在返回时创建的对象的副本.这不是最好的方法!

推荐阅读
贴进你的心聆听你的世界
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有