开发者

Getting Exception when trying to upload a big files size

开发者 https://www.devze.com 2023-03-13 11:43 出处:网络
I\'m using wshttpbinding for my service <wsHttpBinding> <binding name=\"wsHttpBinding_Windows\" maxBufferPoolSize=\"9223372036854775807\" maxReceivedMessageSize=\"2147483647\">

I'm using wshttpbinding for my service

<wsHttpBinding>
            <binding name="wsHttpBinding_Windows" maxBufferPoolSize="9223372036854775807" maxReceivedMessageSize="2147483647">
                <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"/>
                <security mode="Message">
                    <message clientCredentialType="Windows"/>
                </security>
            </binding>
        </wsHttpBinding>

<behavior name="ServiceBehavior">
                <dataContractSerializer  maxItemsInObjectGraph="6553600"/>
                <serviceThrottling maxConcur开发者_运维技巧rentCalls="2147483647" maxConcurrentInstances="2147483647" maxConcurrentSessions="2147483647"/>
            </behavior>

and when i try to upload a file of 15Mb it throws the EndPointNotFoundException below:

Exception Message:

There was no endpoint listening at "MY SERVICE URL" that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Exception:

The remote server returned an error: (404) Not Found.


There are (2) settings maxRequestLength and maxAllowedContentLength on the server side in your WCF confgiration that you are going to need to increase in order for this exception to be resolved. In the .config for the WCF service server side make sure to add the following:

<system.web>
  <!--Increase 'maxRequestLength' to needed value: 100mb (value is in kilobytes)-->
  <httpRuntime maxRequestLength="102400"/>
</system.web>

<system.webServer>
  <security>
    <requestFiltering>
      <!--Increase 'maxAllowedContentLength' to needed value: 100mb (value is in bytes)-->
      <requestLimits maxAllowedContentLength="104857600" />
    </requestFiltering>
  </security>
</system.webServer>


The upload limit is set at 2 level, 1st by the Application and 2nd by the Server.

Your app configuration looks good to me.

Check your IIS settings as defined in your machine.config file. I found a Microsoft KB article to configure this

You can configure the value at any of these places.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号