WebHttpElement 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
WebHttpBehavior通过配置启用终结点。
public ref class WebHttpElement sealed : System::ServiceModel::Configuration::BehaviorExtensionElement
public sealed class WebHttpElement : System.ServiceModel.Configuration.BehaviorExtensionElement
type WebHttpElement = class
inherit BehaviorExtensionElement
Public NotInheritable Class WebHttpElement
Inherits BehaviorExtensionElement
- 继承
- 继承
示例
此示例返回类型 WebHttpElement。
using System;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Configuration;
class Program
{
static void Main(string[] args)
{
WebHttpElement webHttpElement = new WebHttpElement();
Console.WriteLine("The type is: {0}", webHttpElement.BehaviorType);
Console.WriteLine("Press <ENTER> to terminate the program.");
Console.ReadLine();
}
}
注解
WebHttpElement这是一个BehaviorExtensionElement子类型,可用于通过配置在终结点上包括WebHttpBehavior该类型。 与 WebHttpBehavior 绑定结合使用时,WebHttpBinding 行为为 Windows Communication Foundation (WCF) 服务启用 Web 编程模型。 请注意,自动 WebServiceHost 将此行为添加到使用该操作的 WebHttpBinding终结点。
构造函数
| 名称 | 说明 |
|---|---|
| WebHttpElement() |
初始化 WebHttpElement 类的新实例。 |