1
如果任何人都可以帮助我找出为什么在拨打我的WCF服务时出现以下错误,我将永远感激不尽。远程服务器返回意外响应:(413)请求实体太大
传入消息(65536)的最大消息大小配额已超过 。要增加配额,请在适当的绑定元素上使用MaxReceivedMessageSize 属性。
我已经尝试修改服务和客户端上的配置文件,并确保服务名称包含名称空间。我似乎没有取得任何进展。
这里是我的服务配置设置:
<services>
<service name="CCC.CA-CP & 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
{
....
}
预先感谢给予任何帮助!
您需要更改readerQuotas和其他设置都在客户端和服务器端 – Rajesh 2012-08-08 08:40:17
谢谢[远程服务器的建议 – user1583591 2012-08-09 01:44:15
可能的复制返回了意外的响应:(413)请求实体过大](http://stackoverflow.com/questions/20575946/the-remote-server-returned-an-unexpected-response-413-request-entity-too-larg) – abatishchev 2016-04-22 00:14:51