EndpointAddressBuilder 類別

定義

以特定屬性值製造新 (不可變動) 端點位址的處理站。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
繼承
EndpointAddressBuilder

範例

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.

所建立的端點位址,可使用端點位址產生器的 UriIdentity 屬性,取得自己的 URI 與身分識別值集合。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 類別的新執行個體。Initializes a new instance of the EndpointAddressBuilder class.

EndpointAddressBuilder(EndpointAddress)

從現有的端點位址來初始化 EndpointAddressBuilder 類別的新執行個體。Initializes a new instance of the EndpointAddressBuilder class from an existing endpoint address.

屬性

Headers

取得產生器可以建立之端點的位址標頭清單。Gets the list of address headers for the endpoints that the builder can create.

Identity

取得或設定產生器可以建立的端點的身分識別值。Gets or sets the identity for the endpoints that the builder can create.

Uri

取得或設定產生器可以建立的端點的 URI。Gets or sets the URI for the endpoints that the builder can create.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetReaderAtExtensions()

傳回內含有端點位址延伸的 XML 字典讀取器。Returns the XML dictionary reader that contains the extensions of the endpoint address.

GetReaderAtMetadata()

傳回內含與端點位址相關之中繼資料的讀取器。Returns the reader that contains the metadata associated with the endpoint address.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
SetExtensionReader(XmlDictionaryReader)

指定內含有端點位址延伸的 XML 字典讀取器。Specifies the XML dictionary reader that contains the extensions of the endpoint address.

SetMetadataReader(XmlDictionaryReader)

指定內含與端點位址相關之中繼資料的 XML 字典讀取器。Specifies the XML dictionary reader that contains the metadata associated with the endpoint address.

ToEndpointAddress()

建立一個以目前端點位址產生器的屬性值初始化的新端點位址。Creates a new endpoint address initialized with the property values of the current endpoint address builder.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於