Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi Developers,

I am using WCF services for retrieve data from the database. It returns near about 30000 number of rows and in future it must be grater than 30000 rows.


Please help me how to resolve issue or any another approach to retrieve data from the WCF services.

What I have tried:

In application web.config i have set below mention settings,
XML
<system.servicemodel>   
	<bindings>
      <basichttpbinding>
        <binding name="BasicHttpBinding_SampleService" closetimeout="00:11:00" opentimeout="00:11:00" receivetimeout="00:10:00" sendtimeout="00:11:00" allowcookies="false" bypassproxyonlocal="false" maxbufferpoolsize="2147483647" maxreceivedmessagesize="2147483647" usedefaultwebproxy="true" transfermode="Streamed" />        
      </basichttpbinding>        
	</bindings>
    <client>
      <endpoint address="http://localhost:61920/Service/SampleServic.svc"> binding="basicHttpBinding"  bindingConfiguration="BasicHttpBinding_ISampleServic" contract="ISampleServic" name="BasicHttpBinding_ISampleServic" &gt;;      
    </endpoint>
	</client>   
</system.servicemodel>  

and in services web.config configuration as per below settings
XML
<system.servicemodel>
<bindings>
  <basichttpbinding>
	<binding maxbuffersize="2147483647" maxreceivedmessagesize="2147483647">
	  <readerquotas maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="4096" maxnametablecharcount="2147483647" />
	</binding>
  </basichttpbinding>
</bindings>
<behaviors>
  <servicebehaviors>
	<behavior>
	  <servicemetadata httpgetenabled="true" httpsgetenabled="false" />
	  <servicedebug includeexceptiondetailinfaults="true" />
	  <datacontractserializer maxitemsinobjectgraph="2147483646" />
	</behavior>
  </servicebehaviors>
</behaviors>
<protocolmapping>
  <add binding="basicHttpBinding" scheme="http" />
</protocolmapping>
<servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true" />
</system.servicemodel>
<system.webserver>
<modules runallmanagedmodulesforallrequests="true" />
<directorybrowse enabled="false" />
</system.webserver>
Posted
Updated 14-Jun-16 3:39am
v6
Comments
Patrice T 10-Jun-16 9:35am    
What is the usage of the 30000 rows ?

Wrong way.
You have to change the way your app is organized.

30000 rows takes huge time to retreive from database, and it takes huge time to build the grid. There is also very little chances that someone ever have real usage of the 30000 rows in a single grid.

You have to change how your app behave, you probably need to cut the grid in pages with limited records and add a page navigation system and may some search button/field. the grid size will be no more than a couple screen size in height, say about 50 rows at a time.

Users apprciate responsive apps.
You need to provide more details about the usage for more explantions.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 10-Jun-16 16:14pm    
Agree. Fair enough, a 5.
—SA
Patrice T 10-Jun-16 17:20pm    
Thank you
Chetan Chopkar 13-Jun-16 2:08am    
Hi,

Thanks for your response.

I am already enabled paging for the grid view with 10 no of rows fixed. WCF services read all the data from database properly and assign to Data table within seconds, but when it pass to the application it gets time out.
Wrong, wrong, WRONG!

Users NEVER want to look at 30,000 rows. Hell, I don't even like looking at 20 rows.

Setup your grid for paging. You only need to show a small number of rows. Each page the grid shows should generate a request to the WCF service that will return just that number of rows. In LINQ, it's easy. You skip the number of RowsPerPage * (PageRequested - 1) and grab the next RowsPerPage number of rows.

In LINQ, that's very easy with the Skip() and Take() methods.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Jun-16 16:14pm    
Agree. Fair enough, a 5.
—SA
Chetan Chopkar 13-Jun-16 2:09am    
Hi,

Thanks for your response.

I am already enabled paging for the grid view with 10 no of rows fixed. WCF services read all the data from database properly and assign to Data table within seconds, but when it pass to the application it gets time out.
Dave Kreskowiak 13-Jun-16 8:46am    
Probably because you're returning way too much data to the client. You only return a single page, not the entire table from the database.
Hi,

Thanks for your suggestion.

I got the solution,
applying the [XmlSerializerFormat] attribute to the services interface

for Example:

[ServiceContract]
[XmlSerializerFormat]

public interface ISampleService
{
[OperationContract]
DataTable GetSampleData(string s_PageName, string s_L10_UI);

[OperationContract]
SampleCRUDProperties CRUDSampleOperations(SampleProperties sampleProperties)
}

After adding [XmlSerializerFormat] attribute to interface, i have getting response from the WCF Services to Application
 
Share this answer
 
v2
Comments
Vineetha Ravindranath 5-Feb-19 4:00am    
Hi,
after adding [xmlSerializerformat] attribute to interface.

I am getting error like :Error 155 Argument 1: cannot convert from 'Incentive__Entity_Properties.DirectIncv.DirectIncvDetail' to 'Incentive.Incentive_Service.DirectIncvDetail'

How can i solve it . Please help me..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900