My WCF service is throwing a ProtocolException (403) - Request Entity Too Large. This occurs when pushing a file (~100KiB) to a service.
The odd thing is that this only occurs on the hosted (staging) version, not locally. My client config is:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="DefaultBindingConfiguration" closeTimeout="01:00:00" openTimeout="01:00:00" receiveTimeout="01:00:00" sendTimeout="01:00:00" maxBufferSize="1000000000" maxBufferPoolSize="1000000000" maxReceivedMessageSize="1000000000">
<readerQuotas maxDepth="1000000000" maxStringContentLength="1000000000" maxArrayLength="64000000" maxBytesPerRead="1000000000" maxNameTableCharCount="1000000000" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
...
</system.serviceModel>
And my server config is:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxBufferSize="1000000000" maxReceivedMessageSize="1000000000" maxBufferPoolSize="1000000000" sendTimeout="01:00:00" receiveTimeout="01:00:00">
<readerQuotas maxDepth="1000000000" maxStringContentLength="1000000000" maxArrayLength="1000000000" maxBytesPerRead="1000000000" />
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
...
</system.serviceModel>
I've omitted the <behaviours>
section for brevity. The client creates endpoints programmatically, all using DefaultBindingConfiguration
. I can confirm that the server and client binding configurations are taking effect locally by selectively reducing a value to 1
and see it fail.
Any ideas why the hosting server may behave differently from my local server? Notable differences:
- Local OS: Windows 7, Host OS: Windows Server 2012
- Local IIS: 7, Host IIS 8(.5?)
Note: To pre-empt the "those values are too high" and "don't set global values", I am aware of the risks so don't need reminding. :)
Any pointers and suggestions are greatly appreciated.
Update:
This issue has resolved itself. After restarting on of the nodes in the web farm, this behaviour is no longer exhibited. This does not fill me with confidence because if it occurs again, I have no idea how to resolve it. I welcome on answers that can suggest why this may be the case...