惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
D
Darknet – Hacking Tools, Hacker News & Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
MyScale Blog
MyScale Blog
Google DeepMind News
Google DeepMind News
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Proofpoint News Feed
D
Docker
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
Forbes - Security
Forbes - Security
MongoDB | Blog
MongoDB | Blog
Attack and Defense Labs
Attack and Defense Labs
Webroot Blog
Webroot Blog
A
About on SuperTechFans
Schneier on Security
Schneier on Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
IT之家
IT之家
The Last Watchdog
The Last Watchdog
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
Project Zero
Project Zero
B
Blog
Recorded Future
Recorded Future
博客园_首页
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
SegmentFault 最新的问题
Security Archives - TechRepublic
Security Archives - TechRepublic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hacker News: Front Page
T
Threatpost
H
Heimdal Security Blog
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog

博客园 - 牛奶哥

C#点滴 - 深拷贝与浅拷贝 C#点滴 - 抽象类与接口区别 C#点滴 - ?与?? C#点滴 - 值类型与引用类型 C#点滴 - 类型转换 C#点滴 - 关于String C#点滴 – 内建基本类型 C#点滴 – CLR, CTS…等等基本概念 SharePoint 2010 学习资料 初学SilverLight - (3)简单布局 初学SilverLight - (2)第一个SilverLight程序 初学SilverLight - (1)开发环境准备 WCF热带鱼书学习手记 - Security (1) 概述 关于在SharePoint中管理大文件的一些想法 WCF热带鱼书学习手记 - Service Contract Overload WCF热带鱼书学习手记 - client coding WCF热带鱼书学习手记 - metadata WCF热带鱼书学习手记 - ABC WCF热带鱼书学习手记 - Host Type - 牛奶哥
WCF热带鱼书学习手记 - endpoint - 牛奶哥
牛奶哥 · 2009-12-23 · via 博客园 - 牛奶哥

endpoint的作用就是发布服务,它必须包含WCF中A, B和C三个方面的定义,缺一不可。从配置文件上来看

<system.serviceModel>
    <services>
      <service name="MyNamespace.MyService">
        <endpoint contract = "MyNamespace.IMyService"
                        binding  = "wsHttpBinding"
                        address  = "http://localhost:8000/MyService" 
        />
      </service>
    </services>
</system.serviceModel>

相同的服务可以在多个endpoint上发布,但是要确保address不同,例如:

<system.serviceModel>
    <services>
      <service name="MyNamespace.MyService">
        <endpoint contract = "MyNamespace.IMyService"
                        binding  = "wsHttpBinding"
                        address  = "http://localhost:8001/MyService" 
        />
        <endpoint contract = "MyNamespace.IMyService"
                        binding  = "wsHttpBinding"
                        address  = "http://localhost:8002/MyService" 
        />
      </service>
    </services>
</system.serviceModel>

在self-host的情况下,可以用过代码配置endpoint

ServiceHost host = new ServiceHost(typeof(MyService));
Binding wsHttpBinding = new WSHttpBinding();
host.AddServiceEndpoint(typeof(IMyService),
                                      wsHttpBinding,
                                      new Uri("http://localhost:8086/MyService/"));
host.Open();
...            
host.Close();