zoukankan      html  css  js  c++  java
  • WCF运行时错误

    当服务器返回的数据量过大时,客户端显示通信错误。

    今天遇到的问题是“对象图中需要序列化或反序列化的项目数目超过了上限“65536”。

    这个问题需要在WCF系统的服务段和客户端分别修改配置来增加这个上限。

    服务段修改如下:

    <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="default">
              <serviceMetadata />
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="*" behaviorConfiguration="default">
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:1200" />
              </baseAddresses>
            </host>
            <endpoint binding="netTcpBinding" />
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>

    客户端修改如下:

    <system.serviceModel>
        <client>
          <endpoint name="*" address="net.tcp://127.0.0.1:1200" contract="*" binding="netTcpBinding" behaviorConfiguration="default" />
        </client>
        <behaviors>
          <endpointBehaviors>
            <behavior name="default">
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>
          </endpointBehaviors>
        </behaviors>
      </system.serviceModel>
  • 相关阅读:
    inf的设置【知识】
    输入加速【模板】
    floyed算法【最短路】【模板】
    vector的erase函数使用
    欧拉图
    组合索引
    索引的存储
    索引失效
    装饰器和代理模式
    单例模式
  • 原文地址:https://www.cnblogs.com/hyping/p/4449078.html
Copyright © 2011-2022 走看看