zoukankan      html  css  js  c++  java
  • 和我一起学WCF(6):宿主(Hosting)

    WCF所支持的宿主服务:

        1.Self-hosting:控制台应用程序,Windows应用程序,Windows服务,HTTP,TCP,named pipes,MSMQ

       2.IIS/ASP.NET

       3.Windows Activation Service

     

     

    ServiceHost实例必须进行初始化为服务暴露出端点(endpoint)

     

    每个ServiceHost与指定的服务类型相关联

     

    核心方法:

       Open()-------打开信道监听器

       Close()-------关闭信道监听器

     

    ServiceHost host=new ServiceHost(typeof(HelloIndigo.HelloIndigoService));

     

    host.AddServiceEndpoint(typeof(HelloIndigo.IHelloIndigoService),new NetTcpBinding(),"net.tcp://localhost:9000/HelloIndigo");

    host.Open();

     

     

     

    IIS/WAS 宿主

     

    1.请求根据.SVC文件在IIS中的扩展映射到WCF中

    <% @ServiceHost Service="HelloIndigo.HelloIndigoService"%>

    服务类型与@ServiceHost的声明相关

     

     

       

  • 相关阅读:
    细说:Http协议 篇
    连接池
    实践
    事务
    一、Jdbc 入门
    ES6之路第一篇:let、const
    vue2饿了吗之路第二篇:登录
    RabbitMQ(三)——简单模式
    RabbitMQ(二)——模式类型
    RabbitMQ(一)——简介
  • 原文地址:https://www.cnblogs.com/duwamish/p/1268672.html
Copyright © 2011-2022 走看看