user867198
user867198

Reputation: 1648

WCF timeout issue

I am new in WCF tech and i am calling this WCF from my silverlight application.

Now, i have one function defined in WCF, this function calls the SP on the database installed on same PC.

This SP takes 1 minute time to execute and return 82000 rows with 50 columns.

I have set the wcf timeout interval to 20 minutes in my application.

Now, when i call this WCF function from my silverlight app it gives me timeout error after 20 minutes. Since the SP takes 1 minute to execute i wonder why this timeout issue is coming?

What can be the thing that is causing the timeout? What can i do to avoid this? I cant implement paging or anything i need to get all this data at one go.

Please help me guys. I have attached my web.config files for your reference also.

Silverlight web.config file

    <behaviors>
        <endpointBehaviors>
            <behavior name="ExportServiceRestBehavior">
                <webHttp />
            </behavior>
        </endpointBehaviors>
        <serviceBehaviors>
            <behavior name="ExportServiceBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
                <serviceThrottling maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" />
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="ExportServiceBehavior" name="DebtorBal.Web.ExportService1">
            <endpoint binding="basicHttpBinding" bindingConfiguration="ExportServiceBinding"
                contract="DevExpress.Xpf.Printing.Service.IExportService" />
            <endpoint address="rest" behaviorConfiguration="ExportServiceRestBehavior"
                binding="webHttpBinding" bindingConfiguration="ExportServiceRestBinding"
                contract="DevExpress.Xpf.Printing.Service.IExportServiceRest" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <bindings>
        <basicHttpBinding>
            <binding name="ExportServiceBinding" maxReceivedMessageSize="50000000"
                transferMode="Streamed">
                <security>
                    <transport realm="" />
                </security>
            </binding>
            <binding name="myBindingForBigArrays" closeTimeout="00:10:00"
                openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
                maxReceivedMessageSize="2147483647">
                <readerQuotas maxDepth="64" maxStringContentLength="2147483647"
                    maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security>
                    <transport realm="" />
                </security>
            </binding>
        </basicHttpBinding>
        <webHttpBinding>
            <binding name="ExportServiceRestBinding" transferMode="Streamed" />
        </webHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:49261/LsnMonService.svc"
            binding="basicHttpBinding" bindingConfiguration="myBindingForBigArrays"
            contract="ServiceReference1.ILsnMonService" name="BasicHttpBinding_ILsnMonService" />
    </client>
</system.serviceModel>

WCF config file

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true" />
  <behaviors>
    <serviceBehaviors>
      <behavior>
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
        <serviceThrottling maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" />
        <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

Upvotes: 1

Views: 1289

Answers (1)

Faster Solutions
Faster Solutions

Reputation: 7005

It's probably simpler than that. Do you ever close or dispose of your service? If not then it's most likely that your service connection is still open. Once it hits the timeout limit it errors. Explicitly close the service after you get data back from it.

Upvotes: 1

Related Questions