【发布时间】:2013-09-15 11:06:32
【问题描述】:
当在客户端接收文件时,我在 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>
【问题讨论】:
-
您确定此错误发生在服务器上,而不是客户端上吗?看起来问题出在阅读方面。
-
@jlew。是的。你说的对。它在客户端上。
-
那么您的客户使用的是服务参考还是网络参考?
标签: asp.net web-services maxstringcontentlength service-model