문제

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> 
도움이 되었습니까?

해결책

Try this

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

다른 팁

under <system.serviceModel> like below

    <bindings>
          <basicHttpBinding>
                 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
 </basicHttpBinding>
    </bindings>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top