WCF.config file - something is clearly wrong

Folks, I have something wrong with this .config for my WCF. When I send data to it for more than 8192 bytes (by default), it fails, telling me that my "maxStringContentLength" is only 8192. I think I set 10,000,000 here.

Any clues?

<system.serviceModel> <bindings> <wsHttpBinding> <binding name="wsHttpBinding" maxReceivedMessageSize="50000000" maxBufferPoolSize="50000000" messageEncoding="Mtom"> <readerQuotas maxDepth="200" maxStringContentLength="10000000" maxArrayLength="16384" maxBytesPerRead="10000000" maxNameTableCharCount="16384" /> </binding> </wsHttpBinding> </bindings> <services> <service name="PsychCoverage.WcfMT.Admin"> <endpoint address="" binding="wsHttpBinding" contract="PsychCoverage.Common.IAdmin"> <identity> <dns value="localhost" /> </identity> </endpoint> <endpoint address="mex" binding="wsHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfMT/Admin/" /> </baseAddresses> </host> </service> </services> <behaviors> <serviceBehaviors> <behavior > <serviceMetadata httpGetEnabled="True" /> <serviceDebug includeExceptionDetailInFaults="True" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> 
+1
source share
1 answer

You have this, but you are not referencing it in the endpoint element, so .NET uses the default value for wsHttpBinding (8192). Add the configuration you specify using the bindingConfiguration attribute of the endpoint element:

 <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="PsychCoverage.Common.IAdmin"> 

In addition, I would recommend using a different name than wsHttpBinding to prevent confusion.

+2
source

Source: https://habr.com/ru/post/896181/


All Articles