码迷,mamicode.com
首页 > 其他好文 > 详细

WCF配置

时间:2016-02-02 14:51:45      阅读:282      评论:0      收藏:0      [点我收藏+]

标签:

服务端

<system.serviceModel>
    <services>
      <service name="WCF.Homedo.Service.Cache.Service">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsHttpBindingConfiguration"
            contract="Interface.Homedo.Service.ICache" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBindingConfiguration" maxBufferPoolSize="21474835647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="None"></security>
        </binding>
      </wsHttpBinding>
      <netTcpBinding>
        <binding name="netTcpBindingConfiguration" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="24.00:00" sendTimeout="00:10:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10"  >
          <readerQuotas maxDepth="64" maxStringContentLength="2147483647 " maxArrayLength="2147483647 " maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="24.00:00" enabled="true" />
          <security mode="None"></security>
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WCF.Homedo.Service.Cache.Service">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

 

客户端

<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="WSHttpBinding_IService" closeTimeout="00:00:10" openTimeout="00:00:10" receiveTimeout="00.01:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
              maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" />
          </security>
        </binding>
      </wsHttpBinding>
      <netTcpBinding>
        <binding name="NetTcpBinding_IService" closeTimeout="00:00:10" openTimeout="00:00:10" receiveTimeout="00.01:00" sendTimeout="00:01:00"
            transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
            hostNameComparisonMode="StrongWildcard" listenBacklog="10"
            maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="1000"
            maxReceivedMessageSize="2147483647">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
              maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <reliableSession ordered="true" inactivityTimeout="24.00:00"
              enabled="true" />
          <security mode="None">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
            <message clientCredentialType="Windows" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <!--<endpoint address="net.tcp://172.16.220.196:10805/Service.svc" binding="netTcpBinding"
                bindingConfiguration="NetTcpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice1"/>
      <endpoint address="net.tcp://172.16.220.196:10806/Service.svc" binding="netTcpBinding"
                bindingConfiguration="NetTcpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice2"/>
      <endpoint address="net.tcp://172.16.220.196:10807/Service.svc" binding="netTcpBinding"
                bindingConfiguration="NetTcpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice3"/>-->
      <endpoint address="http://172.16.220.196:10605/Service.svc" binding="wsHttpBinding"
                bindingConfiguration="WSHttpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice1"/>
      <endpoint address="http://172.16.220.196:10606/Service.svc" binding="wsHttpBinding"
                bindingConfiguration="WSHttpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice2"/>
      <endpoint address="net.tcp://172.16.220.196:10807/Service.svc" binding="netTcpBinding"
                bindingConfiguration="NetTcpBinding_IService" contract="Interface.Homedo.Service.ICache" name="cacheservice3"/>
    </client>
  </system.serviceModel>

 

WCF配置

标签:

原文地址:http://www.cnblogs.com/wenrouyeshicuo/p/5177354.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!