RIA WCF Service Timeout

I have an application written in silverlight 3.0. It uses RIA services for communication between a client and a server.

My question does not seem to answer very well on the Internet. The client communicates with the server using RIA services, which uses WCF behind the scenes. If the message takes more than 60 seconds, time expires with this message,

'Download failed for request' ApplyUpgrade '. HTTP requrest for http: // localhost: 52403 / ClientBin / DatabaseUpgradeTool-Web-UpgradePackageDomainService.svc / binary 'exceeded the allocated timeout. The time allotted for this operation may have been part of a longer timeout. ''

My server is updating the database, so it takes more than 60 seconds. It is probably double or triple.

I tried settings like this in web.config file,

<services>
    <service name="DatabaseUpgradeTool.Web.UpgradePackageDomainService">
      <endpoint address="" binding="wsHttpBinding" contract="DatabaseUpgradeTool.Web.UpgradePackageDomainService"></endpoint>
      <endpoint address="/soap" binding="basicHttpBinding" contract="DatabaseUpgradeTool.Web.UpgradePackageDomainService"></endpoint>
      <endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="DatabaseUpgradeTool.Web.UpgradePackageDomainService"></endpoint>
    </service>
  </services>
<bindings>
    <customBinding>
      <binding name="BinaryHttpBinding"
               receiveTimeout="00:00:10"
               sendTimeout="00:00:10" 
               openTimeout="00:00:10" 
               closeTimeout="00:00:10">
        <binaryMessageEncoding   />
        <httpTransport keepAliveEnabled="true"/>
      </binding>
    </customBinding>
  </bindings>

Still no joy. Any ideas as to what is wrong with what I tried above? I would expect the above to result in a timeout of 10 seconds, not 60.

Thank.

+3
source share
2 answers

Not sure if this helps, I have not tried it with the timeout settings, but it could point you in the right direction: http://blogs.objectsharp.com/CS/blogs/dan/archive/2010/04/13 /maxitemsinobjectgraph-wcf-ria-services-exception.aspx

0
source

, : Silverlight 4 WCF RIA Service Timeout Problem

:

, , . .

, RIA - , :

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

. - 1 . , , -, Web.config . :

CustomEmployeeDomainContext, , , hook OnCreate . :

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); 

    }
}

.

0

Source: https://habr.com/ru/post/1731951/


All Articles