WebHttpBinding WebHttpBinding WebHttpBinding WebHttpBinding Class

定义

一个绑定,可用于为通过 HTTP 请求(而不是 SOAP 消息)公开的 Windows Communication Foundation (WCF) Web 服务配置终结点。A binding used to configure endpoints for Windows Communication Foundation (WCF) Web services that are exposed through HTTP requests instead of SOAP messages.

public ref class WebHttpBinding : System::ServiceModel::Channels::Binding, System::ServiceModel::Channels::IBindingRuntimePreferences
public class WebHttpBinding : System.ServiceModel.Channels.Binding, System.ServiceModel.Channels.IBindingRuntimePreferences
type WebHttpBinding = class
    inherit Binding
    interface IBindingRuntimePreferences
Public Class WebHttpBinding
Inherits Binding
Implements IBindingRuntimePreferences
继承
WebHttpBindingWebHttpBindingWebHttpBindingWebHttpBinding
实现

注解

WCF Web 编程模型允许开发人员提供通过使用"plain old XML"的 HTTP 请求的 WCF Web 服务 (POX) 样式消息,而不基于 SOAP 的消息。The WCF Web Programming Model allows developers to expose WCF Web services through HTTP requests that use "plain old XML" (POX) style messaging instead of SOAP-based messaging. 为了让客户端使用 HTTP 请求与服务进行通信,必须使用附加了 WebHttpBindingWebHttpBehavior 对服务的终结点进行配置。For clients to communicate with a service using HTTP requests, an endpoint of the service must be configured with the WebHttpBinding that has the WebHttpBehavior attached to it. WCF Web 编程模型还要求使用 WebGetAttributeWebInvokeAttribute 属性对各个服务操作进行批注。The WCF Web Programming Model also requires that the individual service operations are annotated with the WebGetAttribute or WebInvokeAttribute attributes. 这定义了从 URI 和 HTTP 方法到服务操作之间的映射,还定义了用于调用操作和返回结果的消息格式。This defines a mapping from a URI and HTTP method to the service operation, as well as the format of the messages used to call the operation and return the results. 支持在 WCF 中联合和 ASP。AJAX 集成都构建于 WCF Web 编程模型之上。Support in WCF for syndication and ASP.AJAX integration are both built on top of the WCF Web Programming Model.

构造函数

WebHttpBinding() WebHttpBinding() WebHttpBinding() WebHttpBinding()

初始化 WebHttpBinding 类的新实例。Initializes a new instance of the WebHttpBinding class.

WebHttpBinding(String) WebHttpBinding(String) WebHttpBinding(String) WebHttpBinding(String)

使用由配置名称指定的绑定初始化 WebHttpBinding 类的新实例。Initializes a new instance of the WebHttpBinding class with a binding specified by its configuration name.

WebHttpBinding(WebHttpSecurityMode) WebHttpBinding(WebHttpSecurityMode) WebHttpBinding(WebHttpSecurityMode) WebHttpBinding(WebHttpSecurityMode)

使用显式指定的绑定所使用的安全类型初始化 WebHttpBinding 类的新实例。Initializes a new instance of the WebHttpBinding class with the type of security used by the binding explicitly specified.

属性

AllowCookies AllowCookies AllowCookies AllowCookies

获取或设置一个值,该值指示客户端是否接受 Cookie 并根据今后的请求传播 Cookie。Gets or sets a value that indicates whether the client accepts cookies and propagates them on future requests.

BypassProxyOnLocal BypassProxyOnLocal BypassProxyOnLocal BypassProxyOnLocal

获取或设置一个值,该值指示是否对本地地址不使用代理服务器。Gets or sets a value that indicates whether to bypass the proxy server for local addresses.

CloseTimeout CloseTimeout CloseTimeout CloseTimeout

获取或设置在传输引发异常之前可用于关闭连接的时间间隔。Gets or sets the interval of time provided for a connection to close before the transport raises an exception.

(Inherited from Binding)
ContentTypeMapper ContentTypeMapper ContentTypeMapper ContentTypeMapper

获取或设置内容类型映射器。Gets or sets the content type mapper.

CrossDomainScriptAccessEnabled CrossDomainScriptAccessEnabled CrossDomainScriptAccessEnabled CrossDomainScriptAccessEnabled

获取或设置一个值,该值确定是否启用跨域脚本访问。Gets or sets a value that determines if cross domain script access is enabled.

EnvelopeVersion EnvelopeVersion EnvelopeVersion EnvelopeVersion

获取由通过此绑定配置为可接收 HTTP 请求的终结点使用的信封版本。Gets the envelope version that is used by endpoints that are configured by this binding to receive HTTP requests.

HostNameComparisonMode HostNameComparisonMode HostNameComparisonMode HostNameComparisonMode

获取或设置一个值,该值指示在对 URI 进行匹配时,是否使用主机名来访问服务。Gets or sets a value that indicates whether the hostname is used to reach the service when matching the URI.

MaxBufferPoolSize MaxBufferPoolSize MaxBufferPoolSize MaxBufferPoolSize

获取或设置可为缓冲区管理器分配的最大内存量(以字节为单位),该管理器管理使用此绑定的终结点所需的缓冲区。Gets or sets the maximum amount of memory allocated, in bytes, for the buffer manager that manages the buffers required by endpoints that use this binding.

MaxBufferSize MaxBufferSize MaxBufferSize MaxBufferSize

获取或设置为从通道接收消息的消息缓冲区管理器分配并供其使用的最大内存量(以字节为单位)。Gets or sets the maximum amount of memory, in bytes, that is allocated for use by the manager of the message buffers that receive messages from the channel.

MaxReceivedMessageSize MaxReceivedMessageSize MaxReceivedMessageSize MaxReceivedMessageSize

获取或设置绑定可处理的消息的最大大小(以字节为单位)。Gets or sets the maximum size, in bytes, for a message that can be processed by the binding.

MessageVersion MessageVersion MessageVersion MessageVersion

获取由绑定所配置的客户端和服务使用的消息版本。Gets the message version used by clients and services configured with the binding.

(Inherited from Binding)
Name Name Name Name

获取或设置绑定的名称。Gets or sets the name of the binding.

(Inherited from Binding)
Namespace Namespace Namespace Namespace

获取或设置绑定的 XML 命名空间。Gets or sets the XML namespace of the binding.

(Inherited from Binding)
OpenTimeout OpenTimeout OpenTimeout OpenTimeout

获取或设置在传输引发异常之前可用于打开连接的时间间隔。Gets or sets the interval of time provided for a connection to open before the transport raises an exception.

(Inherited from Binding)
ProxyAddress ProxyAddress ProxyAddress ProxyAddress

获取或设置 HTTP 代理的 URI 地址。Gets or sets the URI address of the HTTP proxy.

ReaderQuotas ReaderQuotas ReaderQuotas ReaderQuotas

获取或设置可由配置了此绑定的终结点处理的 SOAP 消息的复杂性约束。Gets or sets constraints on the complexity of SOAP messages that can be processed by endpoints configured with this binding.

ReceiveTimeout ReceiveTimeout ReceiveTimeout ReceiveTimeout

获取或设置连接在撤消之前保持非活动状态的最大时间间隔,在此时间间隔内未接收任何应用程序消息。Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped.

(Inherited from Binding)
Scheme Scheme Scheme Scheme

获取用此绑定配置的通道和侦听器的 URI 传输方案。Gets the URI transport scheme for the channels and listeners that are configured with this binding.

Security Security Security Security

获取与此绑定一起使用的安全设置。Gets the security settings used with this binding.

SendTimeout SendTimeout SendTimeout SendTimeout

获取或设置在传输引发异常之前可用于完成写入操作的时间间隔。Gets or sets the interval of time provided for a write operation to complete before the transport raises an exception.

(Inherited from Binding)
TransferMode TransferMode TransferMode TransferMode

获取或设置一个值,该值指示使用此绑定配置的服务是使用消息传输的流处理模式、缓冲模式还是同时使用这两种模式。Gets or sets a value that indicates whether the service configured with the binding uses streamed or buffered (or both) modes of message transfer.

UseDefaultWebProxy UseDefaultWebProxy UseDefaultWebProxy UseDefaultWebProxy

获取或设置一个值,该值指示是否应使用系统的自动配置 HTTP 代理(如果可用)。Gets or sets a value that indicates whether the auto-configured HTTP proxy of the system should be used, if available.

WriteEncoding WriteEncoding WriteEncoding WriteEncoding

获取或设置用于消息文本的字符编码。Gets or sets the character encoding that is used for the message text.

方法

BuildChannelFactory<TChannel>(BindingParameterCollection) BuildChannelFactory<TChannel>(BindingParameterCollection) BuildChannelFactory<TChannel>(BindingParameterCollection) BuildChannelFactory<TChannel>(BindingParameterCollection)

在客户端上生成通道工厂堆栈,此通道工厂堆栈创建具有指定类型的通道并满足绑定参数集合所指定的功能。Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by a collection of binding parameters.

BuildChannelFactory<TChannel>(Object[]) BuildChannelFactory<TChannel>(Object[]) BuildChannelFactory<TChannel>(Object[]) BuildChannelFactory<TChannel>(Object[])

在客户端上生成通道工厂堆栈,该通道工厂堆栈创建具有指定类型的通道并满足对象数组所指定的功能。Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by an object array.

(Inherited from Binding)
BuildChannelListener<TChannel>(BindingParameterCollection) BuildChannelListener<TChannel>(BindingParameterCollection) BuildChannelListener<TChannel>(BindingParameterCollection) BuildChannelListener<TChannel>(BindingParameterCollection)

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足绑定参数集合所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified by a collection of binding parameters.

(Inherited from Binding)
BuildChannelListener<TChannel>(Object[]) BuildChannelListener<TChannel>(Object[]) BuildChannelListener<TChannel>(Object[]) BuildChannelListener<TChannel>(Object[])

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, BindingParameterCollection)

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, Object[]) BuildChannelListener<TChannel>(Uri, Object[]) BuildChannelListener<TChannel>(Uri, Object[]) BuildChannelListener<TChannel>(Uri, Object[])

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection)

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection)

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[]) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[]) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[]) BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[])

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
BuildChannelListener<TChannel>(Uri, String, Object[]) BuildChannelListener<TChannel>(Uri, String, Object[]) BuildChannelListener<TChannel>(Uri, String, Object[]) BuildChannelListener<TChannel>(Uri, String, Object[])

在服务上生成通道侦听器,该通道侦听器接受具有指定类型的通道并满足所指定的功能。Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified.

(Inherited from Binding)
CanBuildChannelFactory<TChannel>(BindingParameterCollection) CanBuildChannelFactory<TChannel>(BindingParameterCollection) CanBuildChannelFactory<TChannel>(BindingParameterCollection) CanBuildChannelFactory<TChannel>(BindingParameterCollection)

返回一个值,该值指示当前绑定是否可以在客户端上生成满足指定绑定参数集合的通道工厂堆栈。Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the collection of binding parameters specified.

(Inherited from Binding)
CanBuildChannelFactory<TChannel>(Object[]) CanBuildChannelFactory<TChannel>(Object[]) CanBuildChannelFactory<TChannel>(Object[]) CanBuildChannelFactory<TChannel>(Object[])

返回一个值,该值指示当前绑定是否可以在客户端上生成满足对象数组所指定的需求的通道工厂堆栈。Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the requirements specified by an object array.

(Inherited from Binding)
CanBuildChannelListener<TChannel>(BindingParameterCollection) CanBuildChannelListener<TChannel>(BindingParameterCollection) CanBuildChannelListener<TChannel>(BindingParameterCollection) CanBuildChannelListener<TChannel>(BindingParameterCollection)

返回一个值,该值指示当前绑定是否可以在服务上生成满足指定绑定参数集合的通道侦听器堆栈。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the collection of binding parameters specified.

(Inherited from Binding)
CanBuildChannelListener<TChannel>(Object[]) CanBuildChannelListener<TChannel>(Object[]) CanBuildChannelListener<TChannel>(Object[]) CanBuildChannelListener<TChannel>(Object[])

返回一个值,该值指示当前绑定是否可以在服务上生成满足对象数组所指定的条件的通道侦听器堆栈。Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the criteria specified in an array of objects.

(Inherited from Binding)
CreateBindingElements() CreateBindingElements() CreateBindingElements() CreateBindingElements()

返回一个包含在当前绑定中的已排序的绑定元素集合。Returns an ordered collection of binding elements contained in the current binding.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetProperty<T>(BindingParameterCollection) GetProperty<T>(BindingParameterCollection) GetProperty<T>(BindingParameterCollection) GetProperty<T>(BindingParameterCollection)

从绑定堆栈的适当层返回所请求的类型化对象(如果存在)。Returns a typed object requested, if present, from the appropriate layer in the binding stack.

(Inherited from Binding)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ShouldSerializeName() ShouldSerializeName() ShouldSerializeName() ShouldSerializeName()

返回是否应序列化绑定名称。Returns whether the name of the binding should be serialized.

(Inherited from Binding)
ShouldSerializeNamespace() ShouldSerializeNamespace() ShouldSerializeNamespace() ShouldSerializeNamespace()

返回是否应序列化绑定命名空间。Returns whether the namespace of the binding should be serialized.

(Inherited from Binding)
ShouldSerializeReaderQuotas() ShouldSerializeReaderQuotas() ShouldSerializeReaderQuotas() ShouldSerializeReaderQuotas()

确定是否应对读取器配额进行序列化。Determines if reader quotas should be serialized.

ShouldSerializeSecurity() ShouldSerializeSecurity() ShouldSerializeSecurity() ShouldSerializeSecurity()

确定是否应对安全设置进行序列化。Determines if security settings should be serialized.

ShouldSerializeWriteEncoding() ShouldSerializeWriteEncoding() ShouldSerializeWriteEncoding() ShouldSerializeWriteEncoding()

确定是否应对用于序列化的编码进行序列化。Determines if the encoding used for serialization should be serialized.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

IBindingRuntimePreferences.ReceiveSynchronously IBindingRuntimePreferences.ReceiveSynchronously IBindingRuntimePreferences.ReceiveSynchronously IBindingRuntimePreferences.ReceiveSynchronously

获取一个值,该值指示是同步处理传入请求还是异步处理传入请求。Gets a value that indicates whether incoming requests are handled synchronously or asynchronously.

适用于