.net - Need expert advice for WCF Service programming -


!--- i'm sorry if post redundant others, problem project seems resulting of architecture, need general help. ---!

i'm trying configure wcf service connected silverlight 5 client-side , c# class library doing crud requests database. service have pass gigantic amount of data. example, have public ilist< rainrecord> getallrain() method in service class can retrieve hundreds of thousands of records in database, more someday. thought these records smaller batches (i think it's pretty approach).

here's web.config file :

<?xml version="1.0" encoding="utf-8"?>  <!--this file contains web configuration used wcf service. -->  <configuration>    <system.web>     <compilation debug="true" targetframework="4.0" maxbatchgeneratedfilesize="2147483647" maxbatchsize="2147483647" />     <httpruntime maxrequestlength="2147483647" />   </system.web>    <system.servicemodel>     <servicehostingenvironment aspnetcompatibilityenabled="true">      <serviceactivations>        <add service="poseidonservicenamespace.poseidonservice" relativeaddress="~/poseidonservice.svc"/>      </serviceactivations>    </servicehostingenvironment>      <bindings>       <basichttpbinding>         <binding  closetimeout="00:01:00"                   opentimeout="00:01:00"                   receivetimeout="00:10:00"                   sendtimeout="00:01:00"                   allowcookies="false"                   bypassproxyonlocal="false"                   hostnamecomparisonmode="strongwildcard"                   maxbuffersize="2147483647"                   maxbufferpoolsize="2147483647"                   maxreceivedmessagesize="2147483647"                   messageencoding="text"                   textencoding="utf-8"                   transfermode="buffered"                   usedefaultwebproxy="true">           <readerquotas maxdepth="2147483647"                         maxstringcontentlength="2147483647"                         maxarraylength="2147483647"                         maxbytesperread="2147483647"                         maxnametablecharcount="2147483647" />           <security mode="none">             <transport  clientcredentialtype="none"                         proxycredentialtype="none"                         realm="" />             <message clientcredentialtype="username"                      algorithmsuite="default" />           </security>         </binding>       </basichttpbinding>     </bindings>      <behaviors>       <servicebehaviors>         <behavior name="poseidonservicebehavior">           <servicemetadata httpgetenabled="true"/>           <servicedebug includeexceptiondetailinfaults="true"/>           <datacontractserializer maxitemsinobjectgraph="2147483647"/>         </behavior>       </servicebehaviors>     </behaviors>        <services>       <service  behaviorconfiguration="poseidonservicebehavior"                 name="poseidonservicenamespace.poseidonservice">         <endpoint address="http://localhost:49455/poseidonservice.svc"                   binding="basichttpbinding"                   contract="poseidonservicenamespace.iposeidonservice"/>          <endpoint address="mex"                   binding="mexhttpbinding"                   contract="imetadataexchange"/>       </service>     </services>   </system.servicemodel>   <system.webserver>     <modules runallmanagedmodulesforallrequests="true"/>   </system.webserver>  </configuration> 

what changes should in file (and why?), , how should implement public ilist getallrain() method in service?

thank much, i've been banging head on while

are sure need transfer hundreds of thousands of records client application? how client view these records? these records pre-processed / aggregated somehow, or displayed in grid? if preprocessed - consider doing preprocessing on server side. if displayed - consider redesigning interface include paging:

ilist<rainrecord> getlist(int startpage, int pagesize); 

if paging not option, still want retrieve data in batches - can implement manual batching introducing state service (you need know requested list, @ position at, , how data left transfer):

public interface iservice {   guid begingetlist();   ilist<rainrecord> getnextbatch(guid id); } 

empty list or null returned getnextbatch indicate end of transfer. in other words, same paging, implemented using stateful service.

now, if transfering hundreds of thousands of records absolutely neccessary, , must done 1 call - consider using streaming transfer data. need change contract, include stream serialized rainrecords.

another alternative implement duplex service, pass callback client, , when client has finished processing previous batch, can request next. downside of far know, wsdualhttpbinding not supported silverlight.

with binding attached, limited 2gb per batch, believe enough. need tweak timeouts, this post describe possible timeout values in great detail.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -