Edit

Bagikan melalui


EndpointAddressBuilder Class

Definition

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
Inheritance
EndpointAddressBuilder

Examples

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

Remarks

The new endpoint address can have its property values initialized from the property values of an existing endpoint address using the EndpointAddressBuilder(EndpointAddress) constructor.

The endpoint addresses created can have their URI and identity values set using the Uri and Identity properties of the endpoint address builder. Note that EndpointAddress is an immutable class.

Constructors

EndpointAddressBuilder()

Initializes a new instance of the EndpointAddressBuilder class.

EndpointAddressBuilder(EndpointAddress)

Initializes a new instance of the EndpointAddressBuilder class from an existing endpoint address.

Properties

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

Gets or sets the URI for the endpoints that the builder can create.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetReaderAtExtensions()

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

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
SetExtensionReader(XmlDictionaryReader)

Specifies the XML dictionary reader that contains the extensions of the endpoint address.

SetMetadataReader(XmlDictionaryReader)

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.

(Inherited from Object)

Applies to