I have the exact problem: httpwebrequest from SL4 using ssl. After 10 seconds, timeout, but after about 30 i see the response come down in Fiddler. I'm going against a apache server, not IIS.
Do you see this problem on all browsers or on a particular browser.
Found the problem. There is a registry key that controls system-wide web request timeout behavior and some apps set it to 10 seconds (e.g. Install Anywhere): HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ReceiveTimeout
I changed it back to a greater value and now it works fine!
The registry solution seems not friendly for clients who don't want to mess with their browsers settings. Micrsoft does provide api in silverlight to control the timeout. However, the api doesn't affect anything.
Does anyone have any lucks with those api? (See below for example)
public partial class MyDomainClass
{
private TimeSpan _channelFactoryTimeout = TimeSpan.FromSeconds(60);
public TimeSpan ChannelFactoryTimeout
{
get { return _channelFactoryTimeout; }
set { _channelFactoryTimeout = value; }
}
////////////////////////////////////////////
/// Control the timeout duration of browsers
////////////////////////////////////////////
partial void OnCreated()
{
ChannelFactory factory = null;
WebDomainClient<IShipTrackDataClassesContract> domainClient = ((WebDomainClient<IShipTrackDataClassesContract>)this.DomainClient);
factory = domainClient.ChannelFactory;
if (factory != null && factory.Endpoint != null && factory.Endpoint.Binding != null)
{
System.ServiceModel.Channels.Binding bind = factory.Endpoint.Binding;
//bind.SendTimeout = ChannelFactoryTimeout;
//bind.CloseTimeout = ChannelFactoryTimeout;
bind.ReceiveTimeout = ChannelFactoryTimeout;
//bind.OpenTimeout = ChannelFactoryTimeout;
}
}
}
sladapter
All-Star
43609 Points
7910 Posts
Re: Re: Re: Re: WCF RIA Service timeout after 10 seconds
Mar 31, 2011 02:30 PM | LINK
Do you see this problem on all browsers or on a particular browser.
If it is browser specific, take a look at this thread: http://forums.silverlight.net/forums/p/220312/528115.aspx Or try to use ClientHttp stack to see if you still get the same behavior.
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question
aghiutza
Member
8 Points
13 Posts
Re: Re: Re: Re: Re: WCF RIA Service timeout after 10 seconds
Mar 31, 2011 03:46 PM | LINK
Found the problem. There is a registry key that controls system-wide web request timeout behavior and some apps set it to 10 seconds (e.g. Install Anywhere): HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ReceiveTimeout
I changed it back to a greater value and now it works fine!
de_teresa
Member
4 Points
2 Posts
Re: WCF RIA Service timeout after 10 seconds
Jan 13, 2012 07:27 PM | LINK
public partial class MyDomainClass { private TimeSpan _channelFactoryTimeout = TimeSpan.FromSeconds(60); public TimeSpan ChannelFactoryTimeout { get { return _channelFactoryTimeout; } set { _channelFactoryTimeout = value; } } //////////////////////////////////////////// /// Control the timeout duration of browsers //////////////////////////////////////////// partial void OnCreated() { ChannelFactory factory = null; WebDomainClient<IShipTrackDataClassesContract> domainClient = ((WebDomainClient<IShipTrackDataClassesContract>)this.DomainClient); factory = domainClient.ChannelFactory; if (factory != null && factory.Endpoint != null && factory.Endpoint.Binding != null) { System.ServiceModel.Channels.Binding bind = factory.Endpoint.Binding; //bind.SendTimeout = ChannelFactoryTimeout; //bind.CloseTimeout = ChannelFactoryTimeout; bind.ReceiveTimeout = ChannelFactoryTimeout; //bind.OpenTimeout = ChannelFactoryTimeout; } } }