I have a WCF Service Library Project for Duplex Communication, and a Windows Forms Application for testing with service reference to WCF Project.
All Works ok, but when WCF Service try to respond with 136.500 bytes of data, I get error 413 "Request Entity Too Large."
WCF Service Library App.Config
="1.0"="utf-8"
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPublisher" closeTimeout="00:10:00" maxBufferPoolSize="2147483646" receiveTimeout="00:10:00" messageEncoding="Text">
<readerQuotas maxArrayLength="2147483646" maxStringContentLength="2147483646" maxDepth="32"/>
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<services>
<service name="DataService.Publisher">
<endpoint address="" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPublisher" contract="DataService.IPublisher">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/DataService/Publisher/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Windows Forms Application (for Testing) App.Config
="1.0"="utf-8"
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IPublisher" closeTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:10:00" messageEncoding="Text">
<readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="32"/>
<security mode="None" />
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8733/Design_Time_Addresses/DataService/Publisher/" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IPublisher" contract="PublisherService.IPublisher" name="WSDualHttpBinding_IPublisher">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
My Callback Class in Client Application has attribute:
<CallbackBehavior(UseSynchronizationContext:=False,
IncludeExceptionDetailInFaults:=True,
MaxItemsInObjectGraph:=2147483646,
ValidateMustUnderstand:=False)>
Testing:
•Callback with 672 bytes: Ok
•Callback with 2.779 bytes: Ok
•Callback with 136.500 bytes: Error
Thanks and sorry for my english...
What I have tried:
I try other configurations (maxAllowedContentLength, uploadReadAheadSize, ...) in Client app.config (and WCF Service too) like system.web, system.webserver, http-runtime, ...