1
votes

I have a silverlight 4 application with RIA service enabled, also the silverlight uses a WCF service and the whole things are hosted on IIS. I need to increase the timeout of the silverlight for the WCF service and ria services, and IIS 7.5. How can I set the releated timeout settings (ria services, WCF, IIS)? P.S

where are the correspoding fields in the configuration?

1
If you could post the error message it would be easier to help. The web site request could timeout while transferring a lot of data (IIS/web.config setting). Or the database connection could time out while querying a large data set (SQL command setting). What is the error message you're receiving?bperreault
I'm asking about where I can configure the timeout, wherever exists (asp.net, IIS, ria services, wcf services, silverlight)Ahmed Said

1 Answers

0
votes

I faced the same problem, I posted the answer to this question here: Silverlight 4 WCF RIA Service Timeout Problem

Here is the answer:

I answered the same question here: WCF ria service SP1 timeout expired

The answer:

I'll explain my context and I wish it will work for my. I'm sure about that.

First of all to call RIA services, and using some domain context, in my example:

EmployeeDomainContext context = new EmployeeDomainContext();
InvokeOperation<bool> invokeOperation = context.GenerateTMEAccessByEmployee(1, 'Bob');
invokeOperation.Completed += (s, x) =>
    {....};

Nothing new until here. And with this I was facing every time that same timeout exception after 1 minute. I spend quite a lot of time trying to face how to change the timeout definition, I tried all possible changes in Web.config and nothing. The solution was:

Create a CustomEmployeeDomainContext, that is a partial class localizated in the same path of the generated code and this class use the hook method OnCreate to change the behavior of created domain context. In this class you should wrote:

public partial class EmployeeDomainContext : DomainContext
{
    partial void OnCreated()
    {
        PropertyInfo channelFactoryProperty = this.DomainClient.GetType().GetProperty("ChannelFactory");
        if (channelFactoryProperty == null)
        {
            throw new InvalidOperationException(
              "There is no 'ChannelFactory' property on the DomainClient.");
        }

        ChannelFactory factory = (ChannelFactory)channelFactoryProperty.GetValue(this.DomainClient, null);

        factory.Endpoint.Binding.SendTimeout = new TimeSpan(0, 10, 0); 

    }
}

I looking forward for you feedback.