2

I have created wcf datatservices with mysql DB. I am getting data from tables in a quick flash. But when I tried to get data from a view, It is throwing timeout exception. When tried directly in db data is getting very quickly.

I tried by setting the following in web.config.

 <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetHttpBinding" maxBufferPoolSize="2147483647"  closeTimeout="00:01:00"
                 openTimeout="00:01:00"  maxConnections="10"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:10:00"
          maxBufferSize="524288" maxReceivedMessageSize="2147483647" />
      </netTcpBinding>
    </bindings>
    <services>
      <service name="MyService">
        <endpoint address="http://localhost:59825" binding="netTcpBinding"
          bindingConfiguration="NetHttpBinding" name="HttpBinding" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>

still timeout exception.

Edit1:

When I tried with a table, data is getting. I created a view as select * from same table. Now also it is throwing timeout exception.

Please help.

Thanks, Saritha.

Saritha.S.R
  • 800
  • 1
  • 6
  • 19

4 Answers4

2
<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">

      </endpoint>
    </service>
....

Edit:

if you are not getting then plz visit this link:Explaination of different timeout types

Jignesh.Raj
  • 5,776
  • 4
  • 27
  • 56
1

You are probably setting config in asp.net which is client. You need to configure server also (WCF).

You must change receiveTimeout in WCF config.

Also you can use WCF Message Logging for diagnostic.

Vano Maisuradze
  • 5,829
  • 6
  • 45
  • 73
0

I guess this has nothing to do with WCF configuration. Can you please check the permissions on the view in the database and make sure that he has the same permissions as on the table.

rauts
  • 1,018
  • 9
  • 21
0

Since the service seems to work with smaller sets of data, it may be that because you are using a view, it idles while the results are being processed on the database server. In which case you need to set the inactivityTimeout:

<netTcpBinding>
    <binding name="NetHttpBinding" 
             maxBufferPoolSize="2147483647"  
             closeTimeout="00:01:00"
             openTimeout="00:01:00"  
             maxConnections="10"
             receiveTimeout="00:10:00"
             sendTimeout="00:10:00"
             maxBufferSize="524288" 
             maxReceivedMessageSize="2147483647">
        <reliableSession ordered="true" 
                         inactivityTimeout="00:10:00"
                         enabled="true" />
    </binding>
</netTcpBinding>
mrtig
  • 2,217
  • 16
  • 26