0

I'm trying to get my App.Config setup correctly to allow my NetTcp Service to return strings larger than 65536, because Im getting this error below

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

So far this is what I've tried but it doesn't work, I was hoping someone could point out my mistake

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="NetTcpSHWS.Service1" behaviorConfiguration="NetTcpSHWS.Service1Behavior">
        <host>
          <baseAddresses>
            <add baseAddress = "net.tcp://localhost:8732/Design_Time_Addresses/NetTcpSHWS/Service1/" />
          </baseAddresses>
        </host>
        <endpoint name="NetRcpEndPoint" address ="" binding="netTcpBinding" bindingConfiguration="netMyConfig" contract="NetTcpSHWS.IService1">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint name="NetTcpMetadataPoint" address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="NetTcpSHWS.Service1Behavior">
          <serviceMetadata httpGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="False" />
          <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483646" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <netTcpBinding>
        <binding name="netMyConfig"
                 maxBufferSize="2147483647"
                 maxBufferPoolSize="2147483647"
                 maxReceivedMessageSize="2147483647"
                 transferMode="Buffered">
          <readerQuotas maxDepth="32"
                        maxStringContentLength="2147483647"
                        maxArrayLength="2147483647"
                        maxBytesPerRead="2147483647"
                        maxNameTableCharCount="2147483647" />
        </binding>
      </netTcpBinding>
    </bindings>
  </system.serviceModel>
</configuration>

This is just a test app

Domitius
  • 475
  • 6
  • 17
  • http://stackoverflow.com/questions/16265725/wcf-error-the-maximum-message-size-quota-for-incoming-messages-65536-has-bee – Nagaraj S Feb 10 '14 at 09:02
  • I updated the config settings of my original post with the recommended changes but I'm still getting the error – Domitius Feb 10 '14 at 13:19
  • How do you start your service? – athabaska Feb 10 '14 at 13:43
  • No I just localhosted it via vs tools, but I realised I never configured my client side and thats why I was still getting the issue, facepalm – Domitius Feb 11 '14 at 14:55
  • possible duplicate of [The maximum message size quota for incoming messages (65536) has been exceeded](http://stackoverflow.com/questions/2908857/the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceeded) – vcsjones Feb 11 '14 at 23:03

1 Answers1

1

Add bindingConfiguration:

<endpoint name="NetRcpEndPoint" bindingConfiguration="myConfiguration" ... >

<netTcpBinding>
    <binding name="myConfiguration" ...
    </binding>
</netTcpBinding>

If you don't, your binding configuration won't be used (the default configuration will be used instead).

ken2k
  • 48,145
  • 10
  • 116
  • 176
  • Hi, thanks for the answer, I made the changes but Im still getting the error, I updated the config settings in my original post – Domitius Feb 10 '14 at 13:18