【发布时间】:2011-05-31 04:43:35
【问题描述】:
我目前正在实施一项使用WCF discovery 并提供发现端点和公告端点的服务。我还需要使用范围来过滤客户端上宣布/发现的端点。
向 Discovery Endpoint 添加范围效果很好,但我无法确定 Announcement Endpoint 的正确配置。这是我想出的:
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDiscovery>
<announcementEndpoints>
<endpoint kind="udpAnnouncementEndpoint"
behaviorConfiguration="DiscoveryBehavior" />
</announcementEndpoints>
</serviceDiscovery>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="DiscoveryBehavior">
<endpointDiscovery>
<scopes>
<add scope="http://My/Scope"/>
</scopes>
</endpointDiscovery>
</behavior>
</endpointBehaviors>
我认为这不正确,因为我重用了我为 Discovery Endpoint 创建的端点行为。但这是我发现描述我的作用域的唯一方法。
我认为应该可以使用范围进行公告,因为:
- 没有其他方法可以过滤收到的通知
-
EndpointDiscoveryMetadata类(我在收到通知时获得的实例)包含一个属性 Scopes。
但在我的配置下,客户端的 Scopes 集合对于所有端点都是空的,除了 mex 端点(它有两个 tempuri 范围)。
那么,有什么想法可以正确声明公告端点的范围吗? 任何帮助将不胜感激,非常感谢。
【问题讨论】:
标签: wcf service-discovery scopes