缓冲XML内容所需的大小超过了缓冲区配额
问题描述:
我收到错误缓冲XML内容所需的大小超过了缓冲区配额
必要的缓冲XML内容超出了缓冲区配额大小。
从WCF运行SQL Server中的存储过程时。它工作正常,但在实时项目中会引发错误。
任何解决方案?我在WCF消耗的应用程序中完成了以下设置。
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF"
closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:61803/ApicaAzureMonitorAgentReceiverWCF.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF"
contract="Dashboard2WCFData.IApicaAzureMonitorAgentReceiverWCF"
name="BasicHttpBinding_IApicaAzureMonitorAgentReceiverWCF" />
</client>
</system.serviceModel>
在WCF的web.config
我有以下设置。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
答
尝试通过安装过程WCF与消费者应用程序连接,那么你可以从WCF异常得到确切的错误原因按我在我的情况一样在这里Getting Error : The size necessary to buffer the XML content exceeded the buffer quota