Error 413 when uploading large files using WCF Service on IIS7?

I found an article that talks about the 45KB size limit you mentioned in the chat. It includes the configuration changes that were made.

Up vote 1 down vote favorite share g+ share fb share tw.

I have a web application which enables users to upload files. The files are then saved using a WCF service on another service. This uploading works fine until I upload a file around 4.5 MB.

When I upload a file above a certain size, I get the error: Soap Error: 413 The server is refusing to process a request because the request entity is larger than the server is willing or able to process... This error appears in the system event log of the server on which the WCF service is running. The solutions that I've found have told me to change the maxAllowedContentLength and uploadReadAheadSize settings in the applicationHost config file. However changing the maxAllowedContentLength to only created a different error if I set it to something really small and changing the uploadReadAheadSize value didn't have any effect on the problem.

Does anyone know what I have to change and where I have to change it? I've been looking for hours and I'm starting to get impatient :(. Thanks for the help!

EDIT: Ok the web. Config of the WCF Service located in the on the production system is as follows. This is the web.

Config located in the folder that the IIS Site of the WCF Web Services points to: The configuration on the test system is as follows: As you can see, there is no mention of any content length or anything in either one of the files. I have to admit, I'm pretty stumped at this point. But like I said, I'm no expert in things IIS.

EDIT 2: Here is the serviceModel node of my web application's web. Config: This is the web. Config of my web application that calls the WCF service and not the web.

Config of the WCF service itself. Thanks again for any help :) asp.net asp.net-mvc wcf iis7 link|improve this question edited Mar 13 at 8:24 asked Mar 12 at 14:49Chris Braunschweiler626.

I found an article that talks about the 45KB size limit you mentioned in the chat. It includes the configuration changes that were made. codeproject.com/Articles/166763/WCF-Stre... It's possible that your test environment has these changes made so that's one thing to look for/consider.

People sometimes don't overwrite configuration files during deployment so you may have an old file there that just works.

Thank you, Shane! I'll check it out! – Chris Braunschweiler Mar 13 at 7:53 I ended up writing a new WCF service myself.

The problem seemed to be with SOAP. It's working fine with the new WCF service now :). Thanks again for all the help.

– Chris Braunschweiler Mar 19 at 13:40.

You want to change the MaxReceivedMessageSize. I think when I did this I also had to change the MaxBufferPoolSize to the same value. You can do it via the config or via code like this.

Binding. MaxBufferPoolSize = 67108864; binding. MaxReceivedMessageSize = 67108864.

I apologize for my noobness but I'm pretty new to IIS. – Chris Braunschweiler Mar 12 at 15:09 I found the properties but only in the web. Config of my web application.

The web application uses WCF services located on another server to save the files and when it tries to save the files using the WCF services, the 413 error occurs on the machine that hosts the WCF services. I forgot to mention that we have a version running on a test system with all the same configurations (of the web application at least) and it works there. It's just not working on the production server for some reason... So I don't think changing anything in the web.

Config of the web app will fix the problem. – Chris Braunschweiler Mar 12 at 15:13 That would have been good information to share ;( I'll have to think about this some more. It would be in the endpoint config on the WCF service itself.

Can you show that config in the main question? Are you self hosting the WCF service, or using IIS? – CtrlDot Mar 12 at 15:22 What behaviour happens on the web site when the WCF server throws the 413?

Are you catching any errors on that side? – CtrlDot Mar 12 at 15:24.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions