This topic has not yet been rated - Rate this topic

EndpointAddressBuilder Class

A factory for producing new (immutable) endpoint addresses with specific property values.

System.Object
  System.ServiceModel.EndpointAddressBuilder

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
public class EndpointAddressBuilder

The EndpointAddressBuilder type exposes the following members.

  Name Description
Public method Supported by Portable Class Library EndpointAddressBuilder() Initializes a new instance of the EndpointAddressBuilder class.
Public method Supported by Portable Class Library EndpointAddressBuilder(EndpointAddress) Initializes a new instance of the EndpointAddressBuilder class from an existing endpoint address.
Top
  Name Description
Public property Supported by Portable Class Library Headers Gets the list of address headers for the endpoints that the builder can create.
Public property Identity Gets or sets the identity for the endpoints that the builder can create.
Public property Supported by Portable Class Library Uri Gets or sets the URI for the endpoints that the builder can create.
Top
  Name Description
Public method Supported by Portable Class Library Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Supported by Portable Class Library Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Supported by Portable Class Library GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetReaderAtExtensions Returns the XML dictionary reader that contains the extensions of the endpoint address.
Public method GetReaderAtMetadata Returns the reader that contains the metadata associated with the endpoint address.
Public method Supported by Portable Class Library GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Supported by Portable Class Library MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetExtensionReader Specifies the XML dictionary reader that contains the extensions of the endpoint address.
Public method SetMetadataReader Specifies the XML dictionary reader that contains the metadata associated with the endpoint address.
Public method Supported by Portable Class Library ToEndpointAddress Creates a new endpoint address initialized with the property values of the current endpoint address builder.
Public method Supported by Portable Class Library ToString Returns a string that represents the current object. (Inherited from Object.)
Top

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.


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


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ