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>
  • 相关阅读:
    Linux IO接口 监控 (iostat)
    linux 防火墙 命令
    _CommandPtr 添加参数 0xC0000005: Access violation writing location 0xcccccccc 错误
    Visual Studio自动关闭
    Linux vsftpd 安装 配置
    linux 挂载外部存储设备 (mount)
    myeclipse 9.0 激活 for win7 redhat mac 亲测
    英文操作系统 Myeclipse Console 乱码问题
    Linux 基本操作命令
    linux 查看系统相关 命令
  • 原文地址:https://www.cnblogs.com/wholeworld/p/10165268.html
Copyright © 2011-2022 走看看