WCF配置文件分为服务端配置文件及客户端配置文件,很多配置项都是需要前后台同时支持的,具体的信息可以参见:WCF配置文件注释 及 WCF配置文件全攻略
1.maxStringContentLength="2097152"
在客户端配置 maxStringContentLength
2. The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
此异常信息非常明确的指出应当修改客户端配置文件中的 MaxReceivedMessageSize属性,可参考如下代码片段:
<basicHttpBinding>
<binding name="BasicHttpBinding_IPermissionService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360000" maxBufferPoolSize="524288" maxReceivedMessageSize="655360000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<binding name="BasicHttpBinding_IPermissionService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360000" maxBufferPoolSize="524288" maxReceivedMessageSize="655360000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">