EndpointAddressBuilder EndpointAddressBuilder EndpointAddressBuilder EndpointAddressBuilder Class

定义

一个生成具有特定属性值的新的(不可变)终结点地址的工厂。A factory for producing new (immutable) endpoint addresses with specific property values.

public ref class EndpointAddressBuilder
public class EndpointAddressBuilder
type EndpointAddressBuilder = class
Public Class EndpointAddressBuilder
继承
EndpointAddressBuilderEndpointAddressBuilderEndpointAddressBuilderEndpointAddressBuilder

示例

EndpointAddressBuilder eab = new EndpointAddressBuilder();
eab.Uri = new Uri("http://localhost/Uri");
eab.Headers.Add(AddressHeader.CreateAddressHeader("n", "ns", "val"));

eab.Identity = EndpointIdentity.CreateUpnIdentity("identity");

XmlDictionaryReader xdrExtensions = eab.GetReaderAtExtensions();

StringReader sr = new StringReader(@"<myExtension xmlns=""myExtNs"" />");
eab.SetExtensionReader(XmlDictionaryReader.CreateDictionaryReader(XmlReader.Create(sr)));

EndpointAddress ea = eab.ToEndpointAddress();

sr = new StringReader(@"<myMetadata xmlns=""myMetaNs"" />");
XmlDictionaryReader xdrMetaData = eab.GetReaderAtMetadata();

eab.SetMetadataReader(XmlDictionaryReader.CreateDictionaryReader(XmlReader.Create(sr)));
Dim eab As New EndpointAddressBuilder()
eab.Uri = New Uri("http://localhost/Uri")
eab.Headers.Add(AddressHeader.CreateAddressHeader("n", "ns", "val"))

eab.Identity = EndpointIdentity.CreateUpnIdentity("foo")

Dim xdrExtensions As XmlDictionaryReader = eab.GetReaderAtExtensions()

Dim sr As New StringReader("<myExtension xmlns=""myExtNs"" />")
eab.SetExtensionReader(XmlDictionaryReader.CreateDictionaryReader(XmlReader.Create(sr)))

Dim ea As EndpointAddress = eab.ToEndpointAddress()

sr = New StringReader("<myMetadata xmlns=""myMetaNs"" />")
Dim xdrMetaData As XmlDictionaryReader = eab.GetReaderAtMetadata()

eab.SetMetadataReader(XmlDictionaryReader.CreateDictionaryReader(XmlReader.Create(sr)))

注解

该新的终结点地址可以有其自己的属性值,这些属性值是使用 EndpointAddressBuilder(EndpointAddress) 构造函数从现有的终结点地址的属性值初始化而得来。The new endpoint address can have its property values initialized from the property values of an existing endpoint address using the EndpointAddressBuilder(EndpointAddress) constructor.

已创建的终结点地址可以有其自己的 URI 以及使用终结点地址生成器的 UriIdentity 属性设置的标识值。The endpoint addresses created can have their URI and identity values set using the Uri and Identity properties of the endpoint address builder. 请注意,EndpointAddress 是不可变的类。Note that EndpointAddress is an immutable class.

构造函数

EndpointAddressBuilder() EndpointAddressBuilder() EndpointAddressBuilder() EndpointAddressBuilder()

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

EndpointAddressBuilder(EndpointAddress) EndpointAddressBuilder(EndpointAddress) EndpointAddressBuilder(EndpointAddress) EndpointAddressBuilder(EndpointAddress)

从现有的终结点地址初始化 EndpointAddressBuilder 类的新实例。Initializes a new instance of the EndpointAddressBuilder class from an existing endpoint address.

属性

Headers Headers Headers Headers

获取生成器可以创建的终结点的地址标头列表。Gets the list of address headers for the endpoints that the builder can create.

Identity Identity Identity Identity

获取或设置生成器可以创建的终结点的标识。Gets or sets the identity for the endpoints that the builder can create.

Uri Uri Uri Uri

获取或设置生成器可以创建的终结点的 URI。Gets or sets the URI for the endpoints that the builder can create.

方法

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)
GetReaderAtExtensions() GetReaderAtExtensions() GetReaderAtExtensions() GetReaderAtExtensions()

返回包含终结点地址扩展的 XML 字典读取器。Returns the XML dictionary reader that contains the extensions of the endpoint address.

GetReaderAtMetadata() GetReaderAtMetadata() GetReaderAtMetadata() GetReaderAtMetadata()

返回包含与终结点地址关联的元数据的读取器。Returns the reader that contains the metadata associated with the endpoint address.

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)
SetExtensionReader(XmlDictionaryReader) SetExtensionReader(XmlDictionaryReader) SetExtensionReader(XmlDictionaryReader) SetExtensionReader(XmlDictionaryReader)

指定包含终结点地址扩展的 XML 字典读取器。Specifies the XML dictionary reader that contains the extensions of the endpoint address.

SetMetadataReader(XmlDictionaryReader) SetMetadataReader(XmlDictionaryReader) SetMetadataReader(XmlDictionaryReader) SetMetadataReader(XmlDictionaryReader)

指定包含与终结点地址关联的元数据的 XML 字典读取器。Specifies the XML dictionary reader that contains the metadata associated with the endpoint address.

ToEndpointAddress() ToEndpointAddress() ToEndpointAddress() ToEndpointAddress()

创建新的终结点地址,该地址使用当前终结点地址生成器的属性值进行初始化。Creates a new endpoint address initialized with the property values of the current endpoint address builder.

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

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

(Inherited from Object)

适用于