EndpointAddress.WriteTo Method

Definition

Saves the current endpoint address of a specified version to an XML writer or an XML dictionary writer.

Overloads

WriteTo(AddressingVersion, XmlDictionaryWriter)

Saves the current endpoint address of a specified version to a specified XML dictionary writer.

WriteTo(AddressingVersion, XmlWriter)

Saves the current endpoint address of a specified version to a specified XML writer.

WriteTo(AddressingVersion, XmlDictionaryWriter, XmlDictionaryString, XmlDictionaryString)

Saves the current endpoint address of a specified version to an XML dictionary writer with a specified namespace and local name.

WriteTo(AddressingVersion, XmlWriter, String, String)

Saves the current endpoint address of a specified version to an XML writer with a specified namespace and local name.

WriteTo(AddressingVersion, XmlDictionaryWriter)

Source:
EndpointAddress.cs
Source:
EndpointAddress.cs

Saves the current endpoint address of a specified version to a specified XML dictionary writer.

C#
public void WriteTo(System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlDictionaryWriter writer);

Parameters

addressingVersion
AddressingVersion

The AddressingVersion of the current endpoint address.

writer
XmlDictionaryWriter

The XmlDictionaryWriter to which the endpoint address is saved.

Exceptions

writer or addressingVersion is null.

Examples

C#
XmlWriter writer = XmlWriter.Create("addressdata.xml");
XmlDictionaryWriter dictWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);
endpointAddress.WriteTo(
            AddressingVersion.WSAddressing10,
            dictWriter);
writer.Close();

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

WriteTo(AddressingVersion, XmlWriter)

Source:
EndpointAddress.cs
Source:
EndpointAddress.cs

Saves the current endpoint address of a specified version to a specified XML writer.

C#
public void WriteTo(System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlWriter writer);

Parameters

addressingVersion
AddressingVersion

The AddressingVersion of the current endpoint address.

writer
XmlWriter

The XmlWriter to which the endpoint address is saved.

Exceptions

writer or addressingVersion is null.

Examples

C#
XmlWriter writer = XmlWriter.Create("addressdata.xml");
endpointAddress.WriteTo(
            AddressingVersion.WSAddressing10,
            writer);
writer.Close();

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

WriteTo(AddressingVersion, XmlDictionaryWriter, XmlDictionaryString, XmlDictionaryString)

Source:
EndpointAddress.cs
Source:
EndpointAddress.cs

Saves the current endpoint address of a specified version to an XML dictionary writer with a specified namespace and local name.

C#
public void WriteTo(System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlDictionaryWriter writer, System.Xml.XmlDictionaryString localName, System.Xml.XmlDictionaryString ns);

Parameters

addressingVersion
AddressingVersion

The AddressingVersion of the current endpoint address.

writer
XmlDictionaryWriter

The XmlDictionaryWriter to which the endpoint address is saved.

localName
XmlDictionaryString

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

ns
XmlDictionaryString

The XmlDictionaryString that contains the namespace for the XML node to contain the endpoint address.

Exceptions

writer or addressingVersion or localName or ns is null.

Examples

C#
    XmlWriter writer = XmlWriter.Create("addressdata.xml");
    XmlDictionaryWriter dictWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);

    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.WriteTo(
                AddressingVersion.WSAddressing10,
                dictWriter,
                xdLocalName,
                xdNamespace);
    writer.Close();

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

WriteTo(AddressingVersion, XmlWriter, String, String)

Source:
EndpointAddress.cs
Source:
EndpointAddress.cs

Saves the current endpoint address of a specified version to an XML writer with a specified namespace and local name.

C#
public void WriteTo(System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlWriter writer, string localName, string ns);

Parameters

addressingVersion
AddressingVersion

The AddressingVersion of the current endpoint address.

writer
XmlWriter

The XmlWriter to which the endpoint address is saved.

localName
String

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

ns
String

The XmlDictionaryString that contains the namespace for the XML node to contain the endpoint address.

Exceptions

writer or addressingVersion or localName or ns is null.

Examples

C#
    XmlWriter writer = XmlWriter.Create("addressdata.xml");
    XmlDictionaryWriter dictWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);

    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.WriteTo(
                AddressingVersion.WSAddressing10,
                dictWriter,
                xdLocalName,
                xdNamespace);
    writer.Close();

Applies to

.NET Framework 4.8.1 et autres versions
Produit Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1