WCF without endpoint listening to large files

I have a WCF 4.0 service deployed on a dev 2K8R2 server and hosted under IIS 7.5. I am calling it locally from a test application (WPF). I had a problem sending quite large files (via an array of bytes), where I get the following error when trying to send a file of 23 MB (or more) in size.

There was no listening to the http: ///FileStorageClone/FileStorage.svc endpoints that could receive the message. This is often caused by an invalid address or SOAP. See InnerException, if present, for more details.

Up to 19 MB works great. I increased the timeout settings and set the maximum buffer, received messages and array sizes by only 2 GB in the web.config file. An exception is thrown almost immediately (not long enough to have a timeout).

It works using basicHttpBinding, although there will be other types of bindings as fixed next steps.

At first I developed connections with small files, and then moved on to larger ones. At 64 KB, I ran into a maximum buffer and got message sizes. In 4 MB, I found out that I need to raise httpRuntime under system.Web from the default value of 4 GB.

For me, this seems like a problem with IIS or at the site level. Any idea where I might be out?

+6
source share
1 answer

This seems to be more suitable for the IIS layer. Setting requestFiltering in the web.config file or through appcmd.exe are two viable options. In the web.config file, the following example sets a limit of 2.2 billion bytes:

<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2200000000" /> </requestFiltering> </security> </system.webServer> 

Thanks: http://www.dantor.com/support/misc/web-config-requestFiltering-user-agent.aspx

Also, through appcmd.exe, see http://forums.iis.net/t/1066272.aspx

+14
source

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


All Articles