ServiceDiscoveryElement 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示一个配置元素,该元素控制服务的可发现性。
public ref class ServiceDiscoveryElement sealed : System::ServiceModel::Configuration::BehaviorExtensionElement
public sealed class ServiceDiscoveryElement : System.ServiceModel.Configuration.BehaviorExtensionElement
type ServiceDiscoveryElement = class
inherit BehaviorExtensionElement
Public NotInheritable Class ServiceDiscoveryElement
Inherits BehaviorExtensionElement
- 继承
-
ServiceDiscoveryElement
- 继承
-
ServiceDiscoveryElement
注解
将此元素应用于服务的行为配置时,服务可以发现所有公开的终结点。 下面的示例演示如何将服务标记为可发现。 可以使用 EndpointDiscoveryElement 来控制特定终结点的可发现性。
<configuration>
<system.serviceModel>
<services>
<service name="Microsoft.Samples.Discovery.CalculatorService"
behaviorConfiguration="calculatorServiceBehavior">
<endpoint address=""
binding="wsHttpBinding"
contract="Microsoft.Samples.Discovery.ICalculatorService"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="calculatorServiceBehavior">
<serviceDiscovery />
</behavior>
</serviceBehaviors>
</system.serviceModel>
</configuration>
构造函数
| ServiceDiscoveryElement() |
创建 ServiceDiscoveryElement 类的新实例。 |