EndpointAddress.ReadFrom Method (AddressingVersion, XmlReader, String, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Reads an endpoint address for a specified address version with a specified qualified name from a specified XML reader.

Namespace:   System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public static EndpointAddress ReadFrom(
	AddressingVersion addressingVersion,
	XmlReader reader,
	string localName,
	string ns
)

Parameters

addressingVersion
Type: System.ServiceModel.Channels.AddressingVersion

The AddressingVersion of the current endpoint address.

reader
Type: System.Xml.XmlReader

The XmlReader from which the endpoint address is obtained.

localName
Type: System.String

Contains the local name for the XML node to contain the endpoint address.

ns
Type: System.String

Contains the namespace for the XML node to contain the endpoint address.

Return Value

Type: System.ServiceModel.EndpointAddress

The EndpointAddress with the qualified name read from the XML reader.

XmlReader reader = XmlReader.Create("addressdata.xml");
XmlDictionaryReader xReader = XmlDictionaryReader.CreateDictionaryReader(reader);
   // Create an XmlDictionary and add values to it.
XmlDictionary d = new XmlDictionary();
XmlDictionaryString xdLocalName = new XmlDictionaryString(XmlDictionary.Empty, "EndpointReference",0);
XmlDictionaryString xdNamespace = new XmlDictionaryString(XmlDictionary.Empty, "http://www.w3.org/2005/08/addressing", 0);

EndpointAddress createdEA = EndpointAddress.ReadFrom
			    (AddressingVersion.WSAddressing10,
			     xReader,
			     xdLocalName,
			     xdNamespace
			    );

.NET Framework
Available since 3.0
Return to top
Show: