zoukankan      html  css  js  c++  java
  • 3 WCF一些基础铺垫

    1首先上一张wcf通讯图

    a.Proxy代理部分底层调用的是 xxxxClient=> ChannelFactory=>IInpuChannel/IOutChannel...

    b.Transaction、Encoding、Security、transport这些则被封装在了协议栈里面 如BasicHttpBinding协议栈 

    2.很重要的一个知识点,当创建一个binding节点要使其有效,我们要在endPoint节点中添加一个bindingConfiguration的属性,将属性值设置成我们定义的binding节点的名字。

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
      </startup>
      <system.serviceModel>
        <!--以下  新加入的bindings节点-->
        <bindings>
          <netTcpBinding>
            <binding name="MyBinding">
              <security mode="None"></security><!--不要安全-->
            </binding>
          </netTcpBinding>
        </bindings>
        <!--以上  新加入的bindings节点-->
        
        <behaviors>
          <serviceBehaviors>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="WcfService.HomeService">
            <host>
              <baseAddresses>
                <!--<add baseAddress="http://localhost:8733/Design_Time_Addresses/WcfService/HomeService/" />-->
                <add baseAddress="http://localhost:8733/Design_Time_Addresses/WcfService/HomeService" />
              </baseAddresses>
            </host>
            <!--在endPoint这个节点的最后加入了属性 MyBinding-->
            <endpoint address="" binding="netTcpBinding" contract="WcfService.IHomeService" bindingConfiguration="MyBinding">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    
          </service>
        </services>
      </system.serviceModel>
    </configuration>
  • 相关阅读:
    CDQ分治
    K-th Number POJ
    A * B Problem Plus HDU
    Prime Test POJ
    数据结构
    FFT
    mysql查询出相同数据出现的次数,统计相同值的数量
    Laravel 清空配置缓存
    php7 数据导出Excel office 2011中文乱码问题
    PHP file_put_contents函数数据导出csv文件,屏幕字符串逗号分隔符
  • 原文地址:https://www.cnblogs.com/wholeworld/p/10165268.html
Copyright © 2011-2022 走看看