参考:http://consultingblogs.emc.com/merrickchaffer/archive/2007/09/19/WCF-System.Net.WebException_3A00_-The-underlying-connection-was-closed_3A00_-The-connection-was-closed-unexpectedly.aspx

主要是在服务端和客户端增加序列化的配置:

  <dataContractSerializer maxItemsInObjectGraph="2147483646" /> 

服务端: 
<service name="XXX"  beaviorConfiguration="ProductMetadataServiceBehaviors">  

 <behaviors>
          <serviceBehaviors>
            <behavior name="ProductMetadataServiceBehaviors" >
              <!-- Add the following element to your service behavior configuration. -->
              <serviceMetadata httpGetEnabled="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
 客户端:
 <client>
这个endpoint里
的 maxBufferSize="。。。" maxBufferPoolSize="。。。" maxReceivedMessageSize="。。。" 要设置的大一些。。。
    <endpoint XXX....
                      behaviorConfiguration="SerializerBehaviour"/>
        </client>

      <behaviors>
        <endpointBehaviors>
          <behavior name="SerializerBehaviour">
            <dataContractSerializer maxItemsInObjectGraph="2147483646" />
          </behavior>
        </endpointBehaviors>

      </behaviors>  
 

相关文章:

  • 2021-11-20
  • 2021-09-01
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
猜你喜欢
  • 2021-09-19
  • 2021-07-27
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案