Solved

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

Posted on 2014-12-10
4
235 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

21 Experts available now in Live!

Get 1:1 Help Now