Wade Ye

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

1.  There was an error while trying to serialize parameter http://tempuri.org/:vehicles. The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '.  Please see InnerException for more details.

client: web.config

<system.serviceModel>

<behaviors>
      <endpointBehaviors>
        <behavior>
          <dataContractSerializer maxItemsInObjectGraph="65536000"/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <dataContractSerializer maxItemsInObjectGraph="65536000"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>

</system.serviceModel>

service: web.config

<system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
            <dataContractSerializer maxItemsInObjectGraph="655360000"/>
         </behavior>
      </serviceBehaviors>
    </behaviors>

</system.serviceModel>

2. An error (The request was aborted: The request was canceled.) occurred while transmitting data over the HTTP channel.

service: web.config

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="655360000"/>
</behavior>
</serviceBehaviors>
</behaviors>

<bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="1000000000">
          <readerQuotas maxStringContentLength="1000000000" maxArrayLength="1000000000" />
        </binding>
      </basicHttpBinding>
      <customBinding>
        <binding >
          <textMessageEncoding messageVersion="Soap11" />
          <httpTransport keepAliveEnabled="true" maxReceivedMessageSize="1000000000" maxBufferSize="1000000000" maxBufferPoolSize="1000000000"/>
        </binding>
      </customBinding>
</bindings>

</system.serviceModel>

3.  The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

Client: web.config

<httpRuntime shutdownTimeout="1200" executionTimeout="9000" useFullyQualifiedRedirectUrl="true" maxRequestLength="409600000" requestLengthDiskThreshold="40960000" requestValidationMode="2.0" />

Service: web.config

<system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <httpRuntime shutdownTimeout="1200" executionTimeout="9000" useFullyQualifiedRedirectUrl="true" maxRequestLength="409600000" requestLengthDiskThreshold="40960000" requestValidationMode="2.0" />
</system.web>

posted on 2012-11-08 11:30  Wade_Ye  阅读(495)  评论(0编辑  收藏  举报