Solved

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

Posted on 2014-12-10
4
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 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