WSHttpBinding.CreateBindingElements 方法

定义

返回一个包含在当前绑定中的已排序的绑定元素集合。

public:
 override System::ServiceModel::Channels::BindingElementCollection ^ CreateBindingElements();
public override System.ServiceModel.Channels.BindingElementCollection CreateBindingElements ();
override this.CreateBindingElements : unit -> System.ServiceModel.Channels.BindingElementCollection
Public Overrides Function CreateBindingElements () As BindingElementCollection

返回

包含已排序的绑定元素堆栈的 BindingElementCollection,这些绑定元素由 WSHttpBinding 绑定描述。

例外

传输安全模式设置无法提供已启用的可靠会话。

示例

下面的示例演示如何获取 BindingElementCollection,它包含由 WSHttpBinding 绑定描述的已排序的绑定元素堆栈。

WSHttpBinding wsHttpBinding = new WSHttpBinding();
BindingElementCollection beCollection = wsHttpBinding.CreateBindingElements();
Dim wsHttpBinding As New WSHttpBinding()
Dim beCollection As BindingElementCollection = wsHttpBinding.CreateBindingElements()

注解

绑定元素的顺序很重要。 它反映了构造和堆栈协议以及传输通道的顺序。

适用于