Inserting large amount of data through wcf REST
I have an ASP.NET web 开发者_开发知识库application where i am using WCF 4 REST services to insert and get data from the database. But when trying to insert large amount of data like data for 1000 employees i am getting the error 'Unexpected End of File'.
Can anyone suggest a solution. Thanks in advance.
Have you tried setting the Max sizes in the web.config on the WCF services and possibly in the App/Web config file on the client side. It needs to look something like this:
<binding name="NewBinding0" sendTimeout="00:10:00" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
This should work for REST service.
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint helpEnabled="true" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
maxBufferPoolSize="2147483647" automaticFormatSelectionEnabled="true">
<security mode="None"/>
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
精彩评论