• WCF使用net.tcp绑定的配置实例


    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <!--默认http绑定的配置,这里提高了最大传输信息的大小,如不需要可以不设置绑定配置-->
            <binding name="DefaultBasicHttpBinding"  maxBufferSize="10485760" maxReceivedMessageSize="10485760" />
          </basicHttpBinding>
          <netTcpBinding>
            <!--默认net.tcp绑定的配置,貌似必须要对net.tcp方式绑定进行配置-->
            <binding name="DefaultNetTcpBinding" portSharingEnabled="true" transferMode="Buffered">
              <security mode="None" />
            </binding>
          </netTcpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息-->
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="WcfTest.DataService">
            <!-- endpoint 的 address 属性:
                  1、使用绝对路径(网址);
                  2、如果使用相对路径(网址),则将根据 host 的 baseAddress 确定最终路径(网址)。 -->
            
            <!--http绑定方式-->
            <endpoint address="" binding="basicHttpBinding" contract="WcfTest.IDataService" bindingConfiguration="DefaultBasicHttpBinding" />
            <!--net.tcp绑定方式-->
            <endpoint address=""  binding="netTcpBinding" contract="WcfTest.IDataService" bindingConfiguration="DefaultNetTcpBinding" />
    
            <!-- 元数据交换(mex)终结点供相应的服务用于向客户端做自我介绍。此终结点不使用安全绑定,应在部署前确保其安全或将其删除 -->
            
            <!--为http绑定提供元数据-->
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <!--为net.tcp绑定提供元数据-->
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
            
            <!--承载WCF服务的基地址。
                注:当使用ASP.NET网站承载WCF服务时,网站需要使用svc文件进行承载服务,此时基地址将变成svc文件的地址。
            -->
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost/Design_Time_Addresses/DataService/" />
              </baseAddresses>
            </host>
          </service>
        </services>
      </system.serviceModel>
  • 相关阅读:
    Mongoexport导出数据,Mongoimport导入数据,mongodump备份数据,mongorestore恢复恢复
    php7中使用mongodb的驱动
    windows(X64)+apche2.4+php7.2下安装mongodb
    windows(X64)下安装apche2.4+php7.2+mysql5.7
    Django2.0 path与Django1.x版本url正则匹配问题
    Django: ImportError: No module named 'corsheaders'
    linux开启端口
    MySQL 存储过程传参数实现where id in(1,2,3,...)示例
    ubuntu安装pip3
    在Ubuntu 16.04 安装python3.6 环境并设置为默认
  • 原文地址:https://www.cnblogs.com/plus301/p/6040451.html
Copyright © 2020-2023  润新知