配置 DomainContext 客户端超时
在 Silverlight 4 应用程序中,我想增加特定 RIA 服务加载操作的超时(不是针对所有加载,只是在特定情况下)。在 配置超时对于来自 Silverlight 3 客户端的 WCF RIA 服务调用,我点击了一个指向说明的链接,据称该链接允许我设置超时。
它似乎工作正常(没有编译器错误、警告、异常等),只是加载操作仍然提前超时。看来无论有没有修改端点的代码,加载操作都会在 2 分钟后超时。我订阅了 ChannelFactory 上的 Opening 事件,并且在加载操作开始时调用了我的处理程序,因此这似乎确认了 ChannelFactory 正在被使用。另外,我将所有 4 个超时值(接收、打开、关闭、发送)设置为 10 分钟,以确保我没有设置错误。
为什么我无法实际更改 RIA 负载的超时?
In a Silverlight 4 app, I would like to increase the timeout for a specific RIA service load operation (not for all loads, just in a specific case). At Configuring the timeout for a WCF RIA Services call from a Silverlight 3 client I followed a link to instructions that purportedly would allow me to set the timeout.
It appeared to work fine (no compiler error, warning, exception, etc) except that the load operation still timed out early. It appears that with or without the code that modifies the endpoint the load operation is timing out after 2 minutes. There is an Opening event on the ChannelFactory which I subscribed to, and my handler was called at the start of the load operation, so that seems to confirm that the ChannelFactory is being used. Also I set all 4 timeout values (Receive, Open, Close, Send) to 10 minutes just to be sure that I wasn't setting the wrong one.
Why I am unable to actually change the timeout for the RIA load?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现问题在于存在多个超时。我正在使用 EntityFramework 域服务进行 RIA,并且遇到 EntityFramework 超时。我将超时的来源误解为来自 RIA 负载,直到我在堆栈跟踪中注意到超时是服务器端的。我延长了分配的 EntityFramework 命令超时以适应我所需的加载行为。我能够确认,在获得域上下文的通道工厂的引用后,我可以设置 RIA 客户端超时。
自我提示:解决超时问题的一个好方法是首先将其设置得很短,以确认它按预期工作
I discovered the problem was that multiple timeouts were in play. I was using an EntityFramework domain service for RIA, and I was getting an EntityFramework timeout. I was misinterpreting the source of the timeout as being from the RIA load until I noticed in the stack trace that the timeout was server side. I extended the allotted EntityFramework command timeout to fit my desired load behavior. I was able to confirm that after getting a reference to the channel factory for the domain context I could set the RIA client-side timeout.
NOTE TO SELF: a good way to troubleshoot a timeout is to start by setting it really short to confirm it is working as intended