How to bypass the default message size limit in WCF data service

I am having a problem with my WCF data service. One of the tables contains too much data to return (about 80 fields), so that the size limit is exceeded by only one record (more than 60 thousand. According to the estimate, I canโ€™t say for sure, because the message cannot be seen as a result of interruption of message output) .

So far, I have found that it can be circumvented in two ways.

  • To increase the message size limit.
  • To change the data transfer format to Json.

There are some problems to overcome for both solutions.

  • There are many articles on the Internet explaining how to configure the WCF service to resize the buffer or quota of the reader. But I donโ€™t know how the WCF data service works, as the white papers do not show how to configure the WCF data service declaratively. Does the WCF data service support the same configuration metaphors? And how to achieve it?

  • The WCF data service client library does not seem to support the json format out of the box. I have to implement the same functions myself. My question here is that does any odata parser exist in C #?

+3
source share
2 answers

โ„– 1 Streaming Provider ( WCF), WCF OData WCF:

 <system.serviceModel>
 <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
 <services>
     <!-- The name of the service -->
     <service name="PhotoService.PhotoData">
         <!--you can leave the address blank or specify your end point URI-->
         <endpoint binding="webHttpBinding" 
           bindingConfiguration="higherMessageSize" 
           contract="System.Data.Services.IRequestHandler"></endpoint>
     </service>
 </services>
 <bindings>
     <webHttpBinding>
         <!-- configure the maxReceivedMessageSize value to suit the max size of 
                  the request (in bytes) you want the service to receive-->
         <binding name="higherMessageSize" transferMode="Streamed"  
          maxReceivedMessageSize="2147483647"/>
     </webHttpBinding>
 </bindings>

โ„–2 WCF JSON, Atom XML. System.Json , Silverlight?, , , JSON .

+1

JSON WCF, WCF, http://wcfdstoolkit.codeplex.com.

REST "$ format = json", :

http://myservice/Products?$format=json
+1

All Articles