當一需要Return字串(或從資料庫撈大量字串資料回來)造成錯誤,擴大web.config MaxStringContentLength值方式--紅字處預設為8192:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="abc" closeTimeout="00:01:00">
<readerQuotas maxDepth="32" maxStringContentLength="1000000" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="abcd" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
參考資料:
http://social.msdn.microsoft.com/Forums/is/wcf/thread/cab9a5f9-7d2e-4b64-8338-8158b2f2b332