Click here to Skip to main content
15,849,494 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,

Here is my error, I am getting when I implemented WCF Services with nettcpbinding.
I am just reading an string which is in text file and the size of it is around 8MB, i converted it into bye and then read that, so in string it is returning the data , I saw this in debugging but when it is returning this string data to service client on self hosted environment it shows this error :
The maximum message size quota for incoming messages (65536) has been exceeded.

    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
    <compilation debug="true" />
	  <httpruntime maxrequestlength="89535600" />
				<requestlimits maxallowedcontentlength="89535600" />
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
    <endpoint binding="netTcpBinding" bindingconfiguration="TcpSampleBinding">
     contract="WcfServiceLibrary1.IService1" name="SampleClientBinding" />
     <binding name="TcpSampleBinding" closetimeout="00:20:00" opentimeout="00:20:00">
      receiveTimeout="00:20:00" sendTimeout="00:20:00" transactionFlow="false"
      transferMode="Streamed" maxBufferPoolSize="524288" maxBufferSize="2147483647"
      <readerquotas maxdepth="64" maxstringcontentlength="10240" maxarraylength="16384">
       maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <security mode="Transport" />
     <behavior name="SampleTestServiceBehaviour">
      <servicedebug includeexceptiondetailinfaults="true" />
      <servicemetadata />
    <service behaviorconfiguration="SampleTestServiceBehaviour" name="WcfServiceLibrary1.Service1">
     <endpoint address="" binding="netTcpBinding">
      name="SampleNetTcpBinding" contract="WcfServiceLibrary1.IService1" />
     <endpoint address="mex" binding="mexTcpBinding" bindingconfiguration="">
      name="NetTcpMaxBinding" contract="IMetadataExchange" />
       <add baseaddress="net.tcp://localhost:19957/SampleSvc" />

Updated 2-Feb-15 0:30am

Apply binding as given below and use BindingConfiguration for the interface

<binding name="Binding Name" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00">
maxBufferPoolSize="524288" maxBufferSize="2565536" maxReceivedMessageSize="2565536">
<readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2516384">
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientcredentialtype="None">
Share this answer
vishvadeepak 2-Feb-15 7:06am    
I already added this like below but still it is not working
<binding name="TcpSampleBinding" closetimeout="00:20:00" opentimeout="00:20:00"
="" receivetimeout="00:20:00" sendtimeout="00:20:00" transactionflow="false" transfermode="Streamed" maxbufferpoolsize="524288" maxbuffersize="50000000" maxreceivedmessagesize="50000000">
<readerquotas maxdepth="1024" maxstringcontentlength="10240" maxarraylength="16384"
="" maxbytesperread="4096" maxnametablecharcount="16384">
<security mode="None">

If you are running it locally or using an application
Share this answer

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