我正在从我的Silverlight客户端调用我的DomainService,通常需要2分钟。我需要将端点的超时值延长到5分钟才能安全,但似乎忽略了该设置,我找不到原因。这里是我如何在我的客户创造我DomainContext:Silverlight 4 Ria服务超时问题
MyDomainContext context = new MyDomainContext();
((WebDomainClient<MyDomainContext.IMyDomainServiceContract>)context.DomainClient).ChannelFactory.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 5, 0);
context.Search(_myParms, p =>
{
if (p.HasError)
{
// Handle errors
}
// Should take about 2 min. to get here, but times out before
}, null);
我已经尝试设置ReveiveTimeout和双方的SendTimeout,但我总是在完全相同1分钟得到错误。
有人能告诉我我做错了什么吗?
编辑:这是我得到确切的错误:
{System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplayClass5.b_4(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass2.b_0(Object sendState) --- End of inner exception stack trace --- at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state) at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)}
我还测试,以确保它不是在我的服务。目前,我只是让我的服务运行一段时间。再一次,我正好在一分钟内得到这个错误。
感谢,
斯科特
不幸的是,这并没有奏效。在一分钟之后,我仍然会收到同样的错误。我已更新我的原始帖子,以显示我正在收到的确切错误。 – Scott 2011-02-02 19:02:01