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
Solved

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

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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