0

I have a WCF service hosted in IIS. It is for file upload. For large files (4 MB) WCF returns error "Requested url was reject . Please contact admin."

It works for smaller files. Same service is working on different server for large files too. I compared IIS setting between these two servers and everything looks same.

Any suggestion?

Anil
  • 1,669
  • 5
  • 19
  • 44
  • Check if config files are also same for both applications(allowed message size, throttling etc) . Error seems custom error, logging/tracing can also help to inquire root cause. – Pranav Singh Feb 12 '20 at 18:44
  • May be firewall blocking it check answer to https://stackoverflow.com/questions/8892197/how-to-resolve-the-requested-url-was-rejected-please-consult-with-your-adminis – Pranav Singh Feb 12 '20 at 18:47
  • @PranavSingh Thanks for reply. config file is same on both server. Also if firewall is the issue then it should not work for small files too right? – Anil Feb 12 '20 at 18:52
  • Could you find the failed request from IIS log and what's the reseponse server ? IIS or HTTP API? If IIS didn't log it, did you see that error in httperr log? First of all, we need to figure out which level reject the application. There's a default limit in system.web/httpRuntime/Maxrequestlength=4mb. It will block the large file over 4mb. – Jokies Ding Feb 13 '20 at 08:41

1 Answers1

0

This error appears to be a custom error, not an actual error message. If it is an error caused by uploading a too large file, I think it may be a problem with the server configuration. In my experience, you need to include the following configuration.

    <bindings>
      <basicHttpsBinding>
        <binding name="mybinding" maxReceivedMessageSize="2147483647">
        </binding>
      </basicHttpsBinding>
</bindings>

Then apply it in the particular service endpoint.

<services>
      <service name="WcfService1.Service1">
        <endpoint bindingConfiguration="mybinding" address="" binding="basicHttpBinding" contract="WcfService1.IService1"></endpoint>
      </service>
    </services>

At last, I would like to know the practical error if the problem still exists. Feel free to let me know if there is anything I can help with.

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22