Solved

I am getting timeout expired when running a sql stored procedure using WCF

Posted on 2014-12-10
4
236 Views
Last Modified: 2015-01-13
I am getting a message after starting a stored procedure which never came back. The message indicates "Timeout expired or server is not responding". Where can I increase the timeout (the stored procedure is expected to take more than 2 hours.

The web.config file Service model section is as follows:

      <system.serviceModel>
            <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>      
            <bindings>
                  <basicHttpBinding>
                        <binding name = "secureMsg"  maxReceivedMessageSize="4194304">
                        <!-- 4 MB -->
                        </binding>
                  </basicHttpBinding>
            </bindings>
      
            <services>
       <endpoint
                          address="IdeaUtilitiesFacade"
                          binding="basicHttpBinding"
                          bindingConfiguration="secureMsg"
                          contract="Reinsurance.Application.IdeaUtilities.Interface.IIdeaUtilitiesFacade"/>
     </service>
            <behaviors>
                  <serviceBehaviors>
                        <behavior name="Debug_Behaviour">
                              <serviceDebug
                                    httpHelpPageEnabled="false"
                                    includeExceptionDetailInFaults="true"
                              />
                              <serviceMetadata httpGetEnabled="false" />
                              <serviceAuthorization principalPermissionMode="UseWindowsGroups" />      
                        </behavior>
                  </serviceBehaviors>
            </behaviors>
      </system.serviceModel>
0
Comment
Question by:fmichail
  • 2
4 Comments
 
LVL 16

Assisted Solution

by:Kamal Khaleefa
Kamal Khaleefa earned 250 total points
ID: 40493382
system.serviceModel>
  <bindings>
    <netTcpBinding>
      <binding name="longTimeoutBinding"
        receiveTimeout="00:10:00" sendTimeout="00:10:00">
        <security mode="None"/>
      </binding>
    </netTcpBinding>
  </bindings>

  <services>
    <service name="longTimeoutService"
      behaviorConfiguration="longTimeoutBehavior">
      <endpoint address="net.tcp://localhost/longtimeout/"
        binding="netTcpBinding" bindingConfiguration="longTimeoutBinding" />
    </service>
0
 

Author Comment

by:fmichail
ID: 40494132
Dear King2002
I read that InactivityTimeout also has to be adjusted...
Where can I do that?, and is it really necessary? , If I want the timeout to be 5 hours should I set the receiveTimeout="05:00:00"?. and finally, can I apply all these to the basicHttpBinding, I do not want to create a new binding. Thanks for you help
0
 
LVL 3

Accepted Solution

by:
Nico earned 250 total points
ID: 40535951
You should set the sendTimeout on the client binding. This will set the timeout time for the call to the webservice (including waiting for the reply)

InactivityTimeout is for when you use ReliableSession, which is not applicable in your case of a basicHttpBinding.
0
 

Author Closing Comment

by:fmichail
ID: 40547168
Thank you derkesthai, and king2002
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now