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 一样;
  • 相关阅读:
    Activity的启动模式
    Activity的生命周期
    C之静态内存和动态内存
    C之指针的加法
    C之函数返回一个以上的值
    C之交换数据案例
    C之自定义类型
    C之枚举
    联合体
    C之结构体
  • 原文地址:https://www.cnblogs.com/xiangxiong/p/7161643.html
Copyright © 2011-2022 走看看