zoukankan      html  css  js  c++  java
  • serviceBehaviors_dataContractSerializer_maxItemsInObjectGraph 关键**Behavior

           <behaviors>
          <serviceBehaviors>
            <behavior name="STHotel.Product.WCFService.HotelProductBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
    </serviceBehaviors>
        </behaviors>
                  var xd = sh.AddServiceEndpoint(item.jk, tp2, add);
    
    
                        DataContractSerializerOperationBehavior dataContractBehavior = xd.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
                        if (dataContractBehavior != null)
                        {
                            dataContractBehavior.MaxItemsInObjectGraph =int.MaxValue;
                        }
    
    
        DataContractSerializerOperationBehavior tttt = sh.Description.Behaviors[typeof(DataContractSerializerOperationBehavior)] as DataContractSerializerOperationBehavior;
                        tttt.MaxItemsInObjectGraph = int.MaxValue;
    
      ServiceDebugBehavior debugBehavior = sh.Description.Behaviors[typeof(ServiceDebugBehavior)] as ServiceDebugBehavior;
                        debugBehavior.IncludeExceptionDetailInFaults = true;
    ServiceMetadataBehavior 一样;
  • 相关阅读:
    博客
    NFS服务配置
    LAMP环境搭建与配置
    Linux系统管理技巧(下)
    Linux系统管理技巧(上)
    LVM
    安装RPM包或源码包
    Linux第四章 文件和目录管理
    MySQL主从配置 : 配置主和从(一) 配置主
    MySQL主从配置:主从介绍
  • 原文地址:https://www.cnblogs.com/xiangxiong/p/7161643.html
Copyright © 2011-2022 走看看