I
I
Ivan Vyrov2017-07-21 07:41:21
C++ / C#
Ivan Vyrov, 2017-07-21 07:41:21

How to get rid of the limit exceeded error on a WCF host?

Good afternoon!
Encountered a problem with data transfer from client to server (host side error: Maximum message size quota for incoming messages exceeded (65536). To increase the quota, use the MaxReceivedMessageSize property of the corresponding binding element. )

Screen trace
0ce311a3a737492691f9b6359a3ccd68.png
Host config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <appSettings>
    <add key="db" value="assistant" />
    <add key="ip" value="192.168.2.8" />
    <add key="port" value="3307"/>
    <add key="path" value="E:\Ассистент\Файлы"/>
  </appSettings>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="mexBehaviors" name="AssistantWCF.AssistantWCF">
        <endpoint address="Monitoring" binding="basicHttpBinding" contract="AssistantWCF.IAssistantWCF" />
        <endpoint address="Monitoring" binding="mexTcpBinding" contract="AssistantWCF.IAssistantWCF" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://192.168.2.8:10209/" />
            <add baseAddress="net.tcp://192.168.2.8:10207/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mexBehaviors">
          <serviceMetadata httpGetEnabled="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <wsHttpBinding>
        <binding closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00"
          sendTimeout="00:10:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
            maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </wsHttpBinding>
    </bindings>
  </system.serviceModel>
<!--Трассировка-->
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="E:\Ассистент\logs\Traces-server.svclog"  />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>
  <!--Трассировка-->
</configuration>


I can't figure out where the problem is...
There are no errors during tracing from the client side.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2017-07-21
@petermzg

https://stackoverflow.com/questions/14134107/how-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question