WcfTestClient.exe 无法处理循环引用? [英] WcfTestClient.exe not able to handle circular reference?

查看:28
本文介绍了WcfTestClient.exe 无法处理循环引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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.

推荐答案

我在 WCF 测试客户端遇到了同样的问题,即使 IsReference =true 也无法处理此循环引用.mscorlib.dll 中发生类型为System.StackOverflowException"的未处理异常 错误发生在 WCFTestClient.exe 上,但与您的 WCF 服务无关,这就是它落入的原因带有 stackoverflow 错误的 Visual Studio 反汇编.关键是 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... :)

这篇关于WcfTestClient.exe 无法处理循环引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆