【问题标题】:The remote server returned an unexpected response: (413) Request Entity Too Large远程服务器返回意外响应:(413) Request Entity Too Large
【发布时间】:2012-08-08 04:58:06
【问题描述】:

如果有人能帮我弄清楚为什么在调用我的 WCF 服务时出现以下错误,我将永远感激不尽。

传入邮件的最大邮件大小配额 (65536) 已达到 超过。要增加配额,请使用 MaxReceivedMessageSize 相应绑定元素上的属性。

我已经尝试修改服务和客户端上的配置文件,并确保服务名称包含命名空间。我似乎无法取得任何进展。

这是我的服务配置设置:

<services>
      <service name="CCC.CA-CP &amp; Sightlines Campus Carbon Calculator">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="Binding2" contract="CCC.ICCCService" behaviorConfiguration="WebBehavior2" />

      </service>

    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="Binding2" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
          hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
          maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647" messageEncoding="Text"
          textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
            maxBytesPerRead="20000" maxNameTableCharCount="16384" ></readerQuotas>

        </binding>
      </basicHttpBinding>

    </bindings>

..
     <dataContractSerializer maxItemsInObjectGraph="12097151"  />
...
       <requestLimits maxAllowedContentLength="157286400" />
... 
<httpRuntime  useFullyQualifiedRedirectUrl="true" maxRequestLength="2147483647"...

我还使用相同的绑定值设置客户端配置。

这是服务合同:

namespace CCC
{
    [ServiceContract(Name = "CA-CP & Sightlines Campus Carbon Calculator", Namespace = "http://www.sightlines.com/CCC/01")]
    public interface ICCCService
    {

....
}

提前感谢您提供的任何帮助!

【问题讨论】:

标签: c# wcf wcf-binding


【解决方案1】:

服务标签的名称属性没有类实现的名称。它在服务接口的“ServiceContract”属性中具有名称。感谢 Vinay Kumar 的建议。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-23
    • 1970-01-01
    • 1970-01-01
    • 2012-10-05
    • 1970-01-01
    相关资源
    最近更新 更多