잠시 동안 로컬 서비스에서 웹 서비스로 데이터를 전송하는 데 문제가 있었으며 많은 기사를 보았지만 모두 도움이되지 않습니다. .. 응용 프로그램을 실행할 때 다음 오류가 발생합니다. "XML 데이터를 읽는 동안 최대 배열 길이 할당량 (16384)이 초과되었습니다.이 할당량은 XML 데이터를 만들 때 사용되는 XmlDictionaryReaderQuotas 개체의 MaxArrayLength 속성을 변경하여 늘릴 수 있습니다. XML 판독기. "Windows 서비스에서 WCF로 데이터 보내기 - MaxArrayLength Error
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="FileLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter"/>
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IOnlineSyncService" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="50000000" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="50000000" maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:65093/OnlineSyncService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IOnlineSyncService" contract="MyApp.OnlineSyncService.IOnlineSyncService" name="BasicHttpBinding_IOnlineSyncService" />
</client>
</system.serviceModel>
</configuration>
나는 (MySyncService 윈도우 응용 프로그램에서 호출 :
여기에 다음과 같이 내 Windows 서비스에
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IOnlineSyncService" maxReceivedMessageSize="50000000" maxBufferPoolSize="50000000" messageEncoding="Mtom">
<readerQuotas maxDepth="500000000" maxStringContentLength="500000000" maxArrayLength="500000000" maxBytesPerRead="500000000" maxNameTableCharCount="500000000" />
<security mode="None"/>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
내의 App.config은 WCF 서비스에 대한 내 Web.config를합니다. 파일 내용이 Byte()로 정의됩니다.
두 파일 모두에서 MaxArrayLength 속성을 정의하지만 그것은 여전히 나에게 같은 오류를 준다. 내가 함께 팔에서 나는 이 하나 :(