WCF ria 服务 SP1 超时已过期
我的解决方案是 Silverlight,它使用 WCF RIA 服务 SP1 和实体框架 4。
我在加载大尺寸数据时遇到问题。
我收到此错误消息。
System.ServiceModel.DomainServices.Client.DomainException:超时已过期。操作完成之前超时时间已过,或者服务器没有响应。
我认为这是超时的问题,所以我尝试了下面的代码。当我没有安装 WCF Ria 服务“SP1”时它起作用了。 但自从我安装了“SP1”后它就不起作用了。
ChannelFactory<BatchContext.IBatchServiceContract> channel = ((WebDomainClient<BatchContext.IBatchServiceContract>)this.DomainClient).ChannelFactory;
channel.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.SendTimeout = new TimeSpan(0, 30, 0);
我应该怎么办?
My solution is Silverlight which uses WCF RIA service SP1 and Entity Framework 4.
I have a problem with loading large size data.
I've got this error message.
System.ServiceModel.DomainServices.Client.DomainException : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
I think that it's a problem regards with timeout, so I tried below code. It worked when I hadn't install WCF Ria service "SP1".
But it's not working since I've installed "SP1".
ChannelFactory<BatchContext.IBatchServiceContract> channel = ((WebDomainClient<BatchContext.IBatchServiceContract>)this.DomainClient).ChannelFactory;
channel.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 30, 0);
channel.Endpoint.Binding.SendTimeout = new TimeSpan(0, 30, 0);
What should I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将解释我的背景,我希望它对我有用。我确信这一点。
首先调用 RIA 服务,并使用一些域上下文,在我的示例中:
在此之前没有什么新内容。就这样,我每次 1 分钟后都会遇到同样的超时异常。我花了相当多的时间尝试面对如何更改超时定义,我尝试了 Web.config 中所有可能的更改,但一无所获。解决方案是:
创建一个 CustomEmployeeDomainContext,它是一个本地化在生成代码的同一路径中的分部类,该类使用钩子方法 OnCreate 来更改创建的域上下文的行为。在这堂课上你应该写:
我期待你的反馈。
I'll explain my context and I wish it will work for my. I'm sure about that.
First of all to call RIA services, and using some domain context, in my example:
Nothing new until here. And with this I was facing every time that same timeout exception after 1 minute. I spend quite a lot of time trying to face how to change the timeout definition, I tried all possible changes in Web.config and nothing. The solution was:
Create a CustomEmployeeDomainContext, that is a partial class localizated in the same path of the generated code and this class use the hook method OnCreate to change the behavior of created domain context. In this class you should wrote:
I looking forward for you feedback.