1

I'm gettingg this error in an ASP.NET web service whene recieving a file on the client:

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.

I know how to fix this for a WCF service. But where do I have to change maxArrayLength or maxStringContentLength in a ASP.NET web service?

Edit:

In my web.config (server) there is nothing specific to the web service.

this is my binding in app.config (client):

  <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> 
4

2 回答 2

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> 
于 2013-09-11T12:30:50.877 回答
-2

<system.serviceModel>像下面这样

    <bindings>
          <basicHttpBinding>
                 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
 </basicHttpBinding>
    </bindings>
于 2013-09-11T12:27:33.067 回答