共用方式為


EndpointAddress.WriteTo 方法

定義

將指定版本的目前端點位址儲存至 XML 寫入器或 XML 字典寫入器。

多載

WriteTo(AddressingVersion, XmlDictionaryWriter)

將指定版本的目前端點位址儲存至指定的 XML 字典寫入器。

WriteTo(AddressingVersion, XmlWriter)

將指定版本的目前端點位址儲存至指定的 XML 寫入器。

WriteTo(AddressingVersion, XmlDictionaryWriter, XmlDictionaryString, XmlDictionaryString)

將指定版本的目前端點位址儲存至具有指定之命名空間和本機名稱的 XML 字典寫入器。

WriteTo(AddressingVersion, XmlWriter, String, String)

將指定版本的目前端點位址儲存至具有指定之命名空間和本機名稱的 XML 寫入器。

WriteTo(AddressingVersion, XmlDictionaryWriter)

將指定版本的目前端點位址儲存至指定的 XML 字典寫入器。

public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlDictionaryWriter ^ writer);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlDictionaryWriter writer);
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlDictionaryWriter -> unit
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlDictionaryWriter)

參數

addressingVersion
AddressingVersion

目前端點位址的 AddressingVersion

writer
XmlDictionaryWriter

在其中儲存端點位址的 XmlDictionaryWriter

例外狀況

writeraddressingVersionnull

範例

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

適用於

WriteTo(AddressingVersion, XmlWriter)

將指定版本的目前端點位址儲存至指定的 XML 寫入器。

public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlWriter ^ writer);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlWriter writer);
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlWriter -> unit
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlWriter)

參數

addressingVersion
AddressingVersion

目前端點位址的 AddressingVersion

writer
XmlWriter

在其中儲存端點位址的 XmlWriter

例外狀況

writeraddressingVersionnull

範例

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

適用於

WriteTo(AddressingVersion, XmlDictionaryWriter, XmlDictionaryString, XmlDictionaryString)

將指定版本的目前端點位址儲存至具有指定之命名空間和本機名稱的 XML 字典寫入器。

public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlDictionaryWriter ^ writer, System::Xml::XmlDictionaryString ^ localName, System::Xml::XmlDictionaryString ^ ns);
public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlDictionaryWriter ^ writer, System::Xml::XmlDictionaryString ^ localname, System::Xml::XmlDictionaryString ^ ns);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlDictionaryWriter writer, System.Xml.XmlDictionaryString localName, System.Xml.XmlDictionaryString ns);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlDictionaryWriter writer, System.Xml.XmlDictionaryString localname, System.Xml.XmlDictionaryString ns);
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlDictionaryWriter * System.Xml.XmlDictionaryString * System.Xml.XmlDictionaryString -> unit
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlDictionaryWriter * System.Xml.XmlDictionaryString * System.Xml.XmlDictionaryString -> unit
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlDictionaryWriter, localName As XmlDictionaryString, ns As XmlDictionaryString)
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlDictionaryWriter, localname As XmlDictionaryString, ns As XmlDictionaryString)

參數

addressingVersion
AddressingVersion

目前端點位址的 AddressingVersion

writer
XmlDictionaryWriter

在其中儲存端點位址的 XmlDictionaryWriter

localNamelocalname
XmlDictionaryString

XML 節點的本機名稱,以包含端點位址。

ns
XmlDictionaryString

XmlDictionaryString,其中會包含 XML 節點的命名空間,以便包含端點位址。

例外狀況

writeraddressingVersionlocalNamensnull

範例

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

適用於

WriteTo(AddressingVersion, XmlWriter, String, String)

將指定版本的目前端點位址儲存至具有指定之命名空間和本機名稱的 XML 寫入器。

public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlWriter ^ writer, System::String ^ localName, System::String ^ ns);
public:
 void WriteTo(System::ServiceModel::Channels::AddressingVersion ^ addressingVersion, System::Xml::XmlWriter ^ writer, System::String ^ localname, System::String ^ ns);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlWriter writer, string localName, string ns);
public void WriteTo (System.ServiceModel.Channels.AddressingVersion addressingVersion, System.Xml.XmlWriter writer, string localname, string ns);
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlWriter * string * string -> unit
member this.WriteTo : System.ServiceModel.Channels.AddressingVersion * System.Xml.XmlWriter * string * string -> unit
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlWriter, localName As String, ns As String)
Public Sub WriteTo (addressingVersion As AddressingVersion, writer As XmlWriter, localname As String, ns As String)

參數

addressingVersion
AddressingVersion

目前端點位址的 AddressingVersion

writer
XmlWriter

在其中儲存端點位址的 XmlWriter

localNamelocalname
String

XML 節點的本機名稱,以包含端點位址。

ns
String

XmlDictionaryString,其中會包含 XML 節點的命名空間,以便包含端點位址。

例外狀況

writeraddressingVersionlocalNamensnull

範例

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

適用於