如何在Silverlight环境中诊断客户端WCF问题?

发布于 2024-08-22 05:39:24 字数 91 浏览 3 评论 0原文

WCF 诊断似乎在 SL 中不可用。是因为 System.Diagnostics 支持有限还是其他原因?无论如何,当服务器端诊断还不够时,如何跟踪客户端 WCF 问题?

It seems that WCF diagnostics is not available in SL. Is it because of limited System.Diagnostics support or something else? Anyway, how do you track client-side WCF issues when server-side diagnostics is not enough?

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

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

发布评论

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

评论(2

反目相谮 2024-08-29 05:39:24

如果您收到“未找到”错误,最可能的原因是跨域访问策略。我用来尝试诊断这些问题的是 Fiddler2,并查看原始流量。

If you're getting a 'Not Found' Error the most likely cause is the cross domain access policy. What I use to try diagnose those problems is Fiddler2, and look at the raw traffic.

桃扇骨 2024-08-29 05:39:24

确定您的 WCF 服务在调用时没有出现故障吗?如果服务器端出现问题,返回的消息将是 HTTP 状态代码 500。由于安全限制,浏览器不会将任何非 200 消息传递回 silverlight 插件,这会导致 silverlight 抛出经典的 CommunicationException “远程服务器返回错误:NotFound。”

有一些记录良好的解决方法,可以使用 WCF 行为将故障上的 HTTP 状态代码从 500 更改为 200,以便 silverlight 实际上可以访问出现问题的详细信息。更多信息请参见:

http://msdn.microsoft.com /en-us/library/dd470096(VS.95).aspx

http://www.netfxharmonics.com/2009/07/Understanding-WCF-Faults-in-Silverlight-3

Are you sure that your WCF service is not faulting on the call? If something is going wrong on the server-side the returned message will be of HTTP status code 500. Due to security restrictions, the browser will not pass any non-200 messages back to the silverlight plugin which results in silverlight throwing the classic CommunicationException "The remote server returned an error: NotFound."

There are some pretty well documented work-arounds for using a WCF behavior to change the HTTP status code on the fault from 500 to 200 so silverlight will actually have access to the details of what went wrong. More info here:

http://msdn.microsoft.com/en-us/library/dd470096(VS.95).aspx

http://www.netfxharmonics.com/2009/07/Understanding-WCF-Faults-in-Silverlight-3

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