zoukankan      html  css  js  c++  java
  • WCF配置文件

    HOST

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="redisStringConfiguration" type="xxx.xxx.Redis.Configuration.RedisSettings,xxx.xxx.Redis,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
        <section name="redisHotelConfiguration" type="xxx.xxx.Redis.Configuration.RedisSettings,xxx.xxx.Redis,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
      </configSections>
      <redisStringConfiguration db="1" writeServerConStr="192.168.10.9:6379" readServerConStr="192.168.10.9:6379" maxWritePoolSize="100" maxReadPoolSize="100" autoStart="true" localCacheTime="31536000" recordeLog="false" />
      <redisHotelConfiguration db="5" writeServerConStr="192.168.10.9:6379" readServerConStr="192.168.10.9:6379" maxWritePoolSize="100" maxReadPoolSize="100" autoStart="true" localCacheTime="31536000" recordeLog="false" />
    
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
      </startup>
    
      <connectionStrings>
        <add connectionString="server=192.168.10.9;user id=root;password=admin;persistsecurityinfo=True;database=hotel;charset=utf8;AllowUserVariables=True" name="HotelRead" providerName="mysql.data.mysqlclient" />
        <add connectionString="server=192.168.10.9;user id=root;password=admin;persistsecurityinfo=True;database=hotel;charset=utf8;AllowUserVariables=True" name="HotelWrite" providerName="mysql.data.mysqlclient" />
    
        <add connectionString="server=192.168.10.9;user id=root;password=admin;persistsecurityinfo=True;database=wechatbusiness;charset=utf8;AllowUserVariables=True" name="WeChatBizRead" providerName="mysql.data.mysqlclient" />
        <add connectionString="server=192.168.10.9;user id=root;password=admin;persistsecurityinfo=True;database=wechatbusiness;charset=utf8;AllowUserVariables=True" name="WeChatBizWrite" providerName="mysql.data.mysqlclient" />
    
      </connectionStrings>
      <system.serviceModel>
        <services>
        
          <!--产品服务接口 localhost 192.168.20.32-->
          <service name="xxx.xxx.Service.Service.xxx" behaviorConfiguration="ServiceBehaviorCon">
            <endpoint address="net.tcp://localhost:8876/xxx" binding="netTcpBinding" bindingConfiguration="ServiceTcpBinding" contract="xxx.xxx.Service.IService.xxx">
            </endpoint>
          </service>
          
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviorCon">
              <serviceMetadata httpGetEnabled="False" />
    
              <serviceDebug includeExceptionDetailInFaults="True" />
              <!-- 配置运行时吞吐量设置,这些设置可以优化服务性能-->
              <!-- maxConcurrentCalls:该值指定整个 ServiceHost 中正在处理的最多消息数-->
              <!-- maxConcurrentInstances:获取或设置一个值,该值指定服务中可以一次执行的最多 InstanceContext 对象数-->
              <!-- maxConcurrentSessions:获取或设置一个指定 ServiceHost 对象可一次接受的最多会话数的值-->
              <serviceThrottling maxConcurrentCalls="1000" maxConcurrentInstances="1000" maxConcurrentSessions="1000" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <netTcpBinding>
            <!--openTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于打开连接的时间间隔,指定在超时前必须完成打开操作的时间,默认值为 1 分钟。-->
            <!--closeTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于关闭连接的时间间隔,指定在超时前必须完成关闭操作的时间,默认值为 1 分钟。-->
            <!--receiveTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于完成读取操作的时间间隔,指定在超时前必须完成读取操作的时间,默认值为 10 分钟。-->
            <!--sendTimeout【类型 System.TimeSpan】:获取或设置在传输引发异常之前可用于完成写入操作的时间间隔,指定在超时前必须完成写入操作的时间,默认值为 1 分钟。-->
            <!--【注意:如果对绑定或通道启用了事务流,执行操作所需的时间可能会比指定的超时时间长。在这些情况下,将会因为超时过期而导致操作失败,事务也将随之中止。】-->
            <!--maxBufferPoolSize:获取或设置内存中用于对传入消息进行缓冲的最大字节数。默认值为 65,536 字节。
                    【注意:如果接收的数据超过了可进行缓冲处理的数据,则超出缓冲区大小的数据将保留在基础套接字中,直到缓冲区中具有可用于存储剩余数据的空间为止】-->
            <!--maxReceivedMessageSize:获取或设置在采用此绑定配置的通道上可接收的最大消息大小,绑定可处理的最大消息大小(以字节为单位)。默认值为 65,536 字节。
                    【注意:对消息大小进行的此限制旨在降低遭受拒绝服务 (DoS) 攻击的可能性】-->
            <!--maxConnections:取或设置一个值,该值控制客户端上可存入池中以备后续重复使用的最大连接数,以及服务器上可挂起调度的最大连接数。默认值为 10。-->
            <!--listenBacklog:获取或设置可挂起的最大排队连接请求数,返回可挂起的最大排队连接请求数,默认值为 10。
                    【注意:ListenBacklog 是套接字级别的属性,描述要排队的“挂起接受”请求数。应确保最大并发连接数不超过基础套接字队列】-->
            <binding name="ServiceTcpBinding" openTimeout="00:10:00" closeTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferPoolSize="655350" maxReceivedMessageSize="1073741824" maxConnections="500" listenBacklog="1000">
              <security mode="None">
                <message clientCredentialType="None" />
              </security>
              <!--获取或设置可由使用此绑定配置的终结点处理的 SOAP 消息的复杂性约束【下面几个值都是 int 值】-->
              <!--maxArrayLength:获取并设置允许的最大数组长度,默认值为 16384。
                        【注意:此属性值应用于消息处理过程的每个步骤。包括可以扩展消息或消息部分大小的一些步骤。特别是,加密可能会大大增加消息的大小】-->
              <!--maxBytesPerRead:获取并设置允许每次读取返回的最大字节数,默认值为 4096。
                        【注意:此配额与该传输级别在网络上接收的字节数密切相关,但其目的是控制每次读取时可以接收的数据量】-->
              <!--maxDepth:获取并设置最大嵌套节点深度,最大嵌套节点深度,默认值为 32。此配额设置 XML 的嵌套节点深度限制。
                        【注意:不太重要,一般来说常用的 XML 深度不大可能达到32层】-->
              <!--maxNameTableCharCount:获取并设置表名称中允许的最大字符数,表名称中允许的最大字符数,默认值为 16384。
                        【注意:暂时没用】-->
              <!--maxStringContentLength:获取并设置读取器返回的最大字符串长度,读取器返回的最大字符串长度,默认值为 8192。
                        【注意:这个根据实际需要配置下,因为默认长度 8192 对于稍大的对象序列化后的长度很可能不够用】-->
              <readerQuotas maxArrayLength="1073741824" maxStringContentLength="1073741824" />
            </binding>
          </netTcpBinding>
        </bindings>
      </system.serviceModel>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

    Client

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <netTcpBinding>
            <binding name="netTcpServiceBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"  maxReceivedMessageSize="1073741824">
              <security mode="None">
                <transport clientCredentialType="None"/>
              </security>
              <readerQuotas maxStringContentLength ="1073741824" maxArrayLength ="1073741824" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            </binding>
          </netTcpBinding>
        </bindings>
        <client>
        
          <endpoint address="net.tcp://localhost:8877/EastHotelService" binding="netTcpBinding"
                   bindingConfiguration="netTcpServiceBinding"
                   contract="EastWestWalk.Hotel.Service.IService.IEastHotelService"
                   name="HotelServiceEndpoint"/>
                   
        </client>
      </system.serviceModel>
    </configuration>
  • 相关阅读:
    JavaScript构造函数学习笔记
    JavaScript面向对象编程学习笔记
    Maven学习--Maven项目目录、Maven坐标
    Maven学习--安装说明
    Watir问题---gem install watir-classic报错: ERROR: Error installing watir-classic: ERROR: Failed to build gem native extension.
    TestLink问题 —图表中文乱码
    TeskLink—增加一种需求类型(业务流程)(version1.9.8)
    Watir问题--LoadError: cannot load such file -- watir-classic
    Watir--Ruby + Watir环境安装
    Watir问题--Selenium::WebDriver::Error::WebDriverError: unexpected response, code=502, content-type="text/html"
  • 原文地址:https://www.cnblogs.com/refuge/p/9031276.html
Copyright © 2011-2022 走看看