【发布时间】:2011-02-02 16:55:18
【问题描述】:
我正在从我的 Silverlight 客户端调用我的 DomainService,这通常需要大约 2 分钟。为了安全起见,我需要将端点的超时值延长到 5 分钟,但它似乎忽略了该设置,我无法找出原因。以下是我在客户端中创建 DomainContext 的方式:
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:远程服务器返回错误:NotFound。 ---> System.Net.WebException:远程服务器返回错误:NotFound。 在 System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 在 System.Net.Browser.BrowserHttpWebRequest.c_DisplayClass5.b_4(对象 sendState) 在 System.Net.Browser.AsyncHelper.c_DisplayClass2.b_0(对象 sendState) --- 内部异常堆栈跟踪结束 --- 在 System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod,对象状态) 在 System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult 结果)}
我还进行了测试,以确保它不在我的服务范围内。目前,我只是让我的服务运行一个 while 循环。同样,我在一分钟内收到此错误。
谢谢,
-斯科特
【问题讨论】:
标签: silverlight wcf entity-framework timeout wcf-ria-services