0

エラーが発生します:Maximum number of items that can be serialized or deserialized in an object graph is '32767'. Change the object graph or increase the MaxItemsInObjectGraph quota.

サーバー側とクライアント側の web.config は次のようになります。

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="App" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="UserName" algorithmSuite="Default"/>
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<services>
  <service name="USMC.Playbook.DataService.PlaybookService">
    <endpoint address="" behaviorConfiguration="LargeQuotaBehavior" binding="basicHttpBinding"
      bindingConfiguration="basicBinding" name="Playbook" contract="USMC.Playbook.DataService.IPlaybookService"/>
  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="LargeQuotaBehavior">
      <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483647" />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="">
      <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483647" />
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceAuthorization impersonateCallerForAllOperations="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<client>
    <endpoint address="http://localhost/AppService.svc" binding="basicHttpBinding" bindingConfiguration="App" contract="AppService.IAppService" name="App"/>
</client>

リクエストはアイテムをプルするだけなので、エラーをスローするべきではありません。誰でもこのエラーの原因を確認できますか?

4

1 に答える 1

0

この構成をサービス構成に入れ、

構成で見逃しているのは、サービスの動作です。

<system.serviceModel>
  <bindings>
    <basicHttpBinding>
      <binding name="App" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
        <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        <security mode="None">
          <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
          <message clientCredentialType="UserName" algorithmSuite="Default"/>
        </security>
      </binding>
    </basicHttpBinding>
  </bindings>
  <services>
    <service name="USMC.Playbook.DataService.PlaybookService" behaviorConfiguration="SilverlightWCFLargeDataApplication">
      <endpoint address="" behaviorConfiguration="LargeQuotaBehavior" binding="basicHttpBinding"
        bindingConfiguration="basicBinding" name="Playbook" contract="USMC.Playbook.DataService.IPlaybookService"/>
    </service>
  </services>
  <behaviors>
    <endpointBehaviors>
      <behavior name="LargeQuotaBehavior">
        <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483647" />
      </behavior>
    </endpointBehaviors>
    <serviceBehaviors>
      <behavior name="SilverlightWCFLargeDataApplication">
        <dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483647" />
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
        <serviceAuthorization impersonateCallerForAllOperations="false"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
  <client>
    <endpoint address="http://localhost/AppService.svc" binding="basicHttpBinding"    bindingConfiguration="App" contract="AppService.IAppService" name="App"/>

于 2013-09-17T03:48:55.883 に答える