我为几个表创建范围时得到了这个异常,所有这些表都是巨大的设计
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding_ISyncServices" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None" realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="Windows"
negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)
我已经做到MaxReceivedMessageSize2147483647,但它仍然在这条线下给我以下例外
client.GetTableDescription(scopeName, syncTable)
Run Code Online (Sandbox Code Playgroud)
已超出传入邮件的最大邮件大小限额(65536).
要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性.
我在WCF调用上收到以下错误:
在对象图中可以序列化或反序列化的最大项数是'65536'
我已经阅读了大量的论坛帖子,其中许多人提到修改app.config和web.config以指定允许更大对象图的新行为.我已经做到了,这就是我在这些文件中所拥有的:
关于WPF项目的App.Config:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="">
<dataContractSerializer maxItemsInObjectGraph="2147483646"/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="digiPM.Shell.LogOutPMSEMRService.PMSEMRLogOutService">
<!--<endpoint address="" binding="basicHttpBinding" contract="digiPM.Shell.LogOutPMSEMRService.IPMSEMRLogOutService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/digiPM.Shell.LogOutPMSEMRService/PMSEMRLogOutService/" />
</baseAddresses>
</host>-->
<endpoint address="" binding="netTcpBinding" name="NetTcpBindingEndpoint" contract="digiPM.Shell.LogOutPMSEMRService.IPMSEMRLogOutService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MexTcpBidingEndpoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8732/Design_Time_Addresses/digiPM.Shell.LogOutPMSEMRService/PMSEMRLogOutService/" />
</baseAddresses>
</host>
</service>
</services>
<!--binding info - …Run Code Online (Sandbox Code Playgroud) .net wcf datacontractserializer servicebehavior xmlserializer
我知道这已被问过很多次了,并相信我,我一直在寻找和尝试其中许多下午半天,但仍然无法超越这个.
我正在尝试通过Web服务提交一些表单内容(也可能包含附件),但是当我尝试附加除小文件之外的任何内容时,仍然会收到以下错误.
我的完整错误是:
格式化程序在尝试反序列化消息时抛出异常:尝试反序列化参数http://tempuri.org/:scChildForm时出错 .InnerException消息是'反序列化MashForms.Models.SCChildrenForm类型的对象时出错.读取XML数据时已超出最大数组长度配额(16384).通过更改创建XML阅读器时使用的XmlDictionaryReaderQuotas对象上的MaxArrayLength属性,可以增加此配额.第1行,第41713位.'.有关更多详细信息,请参阅InnerException.
无论我多少尝试在WCF服务和Web客户端的web.config中覆盖该值,它仍然会报告为最大错误和随后的错误.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<!--<httpRuntime maxRequestLength="409600" executionTimeout="300" />-->
</system.web>
<connectionStrings>
<add name="MashFormsContext" connectionString="Data Source=ServerName;Initial Catalog=MashFormsDev;Persist Security Info=True;User ID=UserName;Password=Password" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceTimeouts transactionTimeout="05:05:00" />
<serviceThrottling maxConcurrentCalls="500" maxConcurrentSessions="500" maxConcurrentInstances="2147483647" />
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!--<serviceMetadata httpsGetEnabled="true"/>-->
<!-- To receive exception …Run Code Online (Sandbox Code Playgroud)