我在收到客户端文件的ASP.NET Web服务中收到此错误:
The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
我知道如何为WCF服务修复此问题。但是,我必须在ASP.NET Web服务中更改maxArrayLength
或maxStringContentLength
?
修改
在我的web.config(服务器)中,没有任何特定于Web服务。
这是我在app.config(客户端)中的绑定:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OMCServiceSoap" maxReceivedMessageSize="10000000" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/1820/Service/OMCService.asmx"
binding="basicHttpBinding" bindingConfiguration="OMCServiceSoap"
contract="ServiceReference.OMCServiceSoap" name="OMCServiceSoap" />
</client>
</system.serviceModel>
答案 0 :(得分:4)
试试这个
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OMCServiceSoap" maxReceivedMessageSize="10000000">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/1820/Service/OMCService.asmx"
binding="basicHttpBinding" bindingConfiguration="OMCServiceSoap"
contract="ServiceReference.OMCServiceSoap" name="OMCServiceSoap" />
</client>
</system.serviceModel>
答案 1 :(得分:-2)
下的<system.serviceModel>
<bindings>
<basicHttpBinding>
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</basicHttpBinding>
</bindings>