I am making a call from my Silverlight client into my DomainService that normally takes about 2 minutes. I need to extend the timeout value of the endpoint to 5 minutes to be safe, but it appears to ignore the setting and I can't find out why. Here is how I am creating my DomainContext in my client:
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);
I have tried setting the ReveiveTimeout and SendTimeout both, but I always get the error at exactly 1 minute.
Can someone tell me what I am doing wrong?
EDIT: This is the exact error I am getting:
{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)}
I have also tested to make sure it's not something in my service. At present, I just have my service run a while loop. Again, I get this error at exactly one minute.
Thanks,
-Scott