Silverlight4 client timouts on long running WCF calls
Hi I have silverlight client timeout problem tried the
TimeSpan getSessionMapTimout = new TimeSpan(0, 20, 0);
Client.Endpoint.Binding.CloseTimeout = getSessionMapTimout;
Client.Endpoint.Binding.ReceiveTimeout = getSessionMapTimout;
Client.Endpoint.Binding.SendTimeout = getSessionMapTimout;
Client.Endpoint.Binding.OpenTimeout = getSessionMapTimout;
Client.InnerChannel.OperationTimeout = getSessionMapTimout;
options including the InnerChannel.OperationTimeout
, None of them work the silverli开发者_运维百科ght client still timesout in 30 secs .
The interesting thing is the IE regestry settings "ReceiveTimeout"=dword:00007530
seem to override the Silverlight client settings, cause if i remove this from the registry, everything works fine.
How to make these timeout working from with in silverlight and override IE registry settings.
What kind of binding are you using? I'm using the Duplex binding for hours / days at a time and there's no issue.
Did you check the timeout on the server side? There's also the ASP.NET connection timeout to take into consideration (I think it's set to 30s or something by default).
I have found that, using the client stack outside of IE (in out-of-browser mode), requests that take longer than 10 seconds fail with an ArgumentNullException coming from HttpWebRequest.EndGetResponse(). From what I've seen on the web, other people have also experienced this in Firefox and Chrome, but in IE it seems to work fine (presumably it waits indefinitely and you can roll your own timeout).
I don't believe there's an API in the client stack for setting the timeout.
You need to use the Client Http stack in Silverlight if you need to extend the timeout. The standard browser stack that Silverlight uses has a timeout set by the browser and you can't manipulate it.
HttpWebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
That will register all Http to be on the client stack. However, using this method has some limitation. This page has a great chart showing the difference between the two stacks.
精彩评论