2

我正在为我的服务使用 wshttpbinding

<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 maxConcurrentCalls="2147483647" maxConcurrentInstances="2147483647" maxConcurrentSessions="2147483647"/>
            </behavior>

当我尝试上传 15Mb 的文件时,它会在下面抛出 EndPointNotFoundException:

异常消息:

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.

例外:

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

2 回答 2

15

WCF 配置中有 (2) 个设置maxRequestLengthmaxAllowedContentLength服务器端,您需要增加这些设置才能解决此异常。在 WCF 服务服务器端的 .config 中,确保添加以下内容:

<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>
于 2012-11-13T13:46:56.883 回答
1

上传限制设置为 2 级,第 1 级由应用程序设置,第 2 级由服务器设置。

您的应用配置对我来说看起来不错。

检查您在 machine.config 文件中定义的 IIS 设置。我找到了一篇Microsoft 知识库文章 来配置它

您可以在任何这些位置配置值。

于 2011-06-17T10:03:25.670 回答