Binding.Namespace Binding.Namespace Binding.Namespace Binding.Namespace Property

定义

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

public:
 property System::String ^ Namespace { System::String ^ get(); void set(System::String ^ value); };
public string Namespace { get; set; }
member this.Namespace : string with get, set
Public Property Namespace As String

属性值

绑定的 XML 命名空间。The XML namespace of the binding. 默认值为“http://tempuri.org/”。The default value is "http://tempuri.org/".

异常

该值不能设置为 nullThe value set cannot be null.

注解

每个 Binding 实例都具有 NameNamespace,它们结合起来在服务的元数据中唯一标识绑定的用户名。Each instance of a Binding has a Name and Namespace that together uniquely identify the user name for the binding in the metadata of the service.

绑定的这一用户名不同于协议名称的规范,后者由 Scheme 属性指定。This user name for the binding is distinct from the specification of the protocol name, which is specified by the Scheme property. 例如,如果要添加更多 HTTP 绑定,可以将它们命名为任何名称,并可将其所有架构都设置为“http”。If you want to add more HTTP bindings, for example, you can name them whatever you want and set all of their schemes to "http". 不存在基于 Scheme 的固有应用程序或计算机调度。There is no inherent application or machine dispatch based on the Scheme. 这样,就避免了一个常见问题,即无法为已知协议注册附加处理程序。So you avoid the common problem of being unable to register additional handlers for well-known protocols. 通过给每个版本提供不同的名称,还可以轻松地并行使用一个绑定的多个版本。You can also easily work with multiple versions of a binding side-by-side by giving each version a different name.

适用于