WcfTestClient.exe 无法处理循环引用?

发布于 2024-12-23 16:56:49 字数 292 浏览 3 评论 0原文

我正在开发一个 wcf 项目。我的一些服务返回包含循环引用的对象。这些对象的序列化是通过在 DataContract 属性上将 IsReference 设置为 true 来处理的,因此如果我编写代码来调用这些服务,一切都会正常工作。但对于简单的测试,我似乎更喜欢使用 GUI 界面 WcfTestClient.exe,结果发现 WcfTestClient 无法显示循环引用的对象。

我知道如果没有处理任何特殊的情况,尝试显示包含彼此引用的对象将导致无限递归。我只是想知道这是否意味着无法测试通过 WcfTestClient 返回循环引用对象的服务?谢谢。

I'm working on a wcf project. Some of my services return objects that contain circular references. The serialization of these objects is handled through setting IsReference to true on DataContract attribute, so everything works fine if i write code to call those services. But for simple testing, it seems more preferable to me to use the GUI interface WcfTestClient.exe, and it turns out that WcfTestClient fails to display circularly referenced objects.

I know trying to display objects which contain references to each other will cause infinite recursion if nothing special has been processed. I just wonder does that mean it is impossible to test services that return circularly referenced objects via WcfTestClient ? Thanks.

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

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

发布评论

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

评论(1

久随 2024-12-30 16:56:49

您好,我在 WCF 测试客户端上遇到了同样的问题,即使 IsReference =true,它也无法处理此循环引用。 在 mscorlib.dll 中发生了类型为“System.StackOverflowException”的未处理异常错误发生在 WCFTestClient.exe 上,但不是发生在您的 WCF 服务中,这就是它陷入困境的原因Visual Studio 反汇编出现 stackoverflow 错误。重点是 WCFTestClient 并不打算或期望像 Visual Studio 对象树那样的循环引用。希望你理解。无论如何,好问题...:)

Hi I had the same problem with WCF test client , which cannot able to handle this circular reference even the IsReference =true. An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll error is happening at the WCFTestClient.exe , but not with your WCF service, that's why it's falling to the visual studio Disassembly with the stackoverflow error. the point is WCFTestClient is not intended or expecting a circular reference like visual studio object tree. Hope you understand. nice question anyway... :)

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