EndpointAddress.WriteTo 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定版本的当前终结点地址保存到 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。
例外
writer
或 addressingVersion
为 null
。
示例
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
或 addressingVersion
为 null
。
示例
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 节点的本地名称。
XmlDictionaryString,其中包含要包含终结点地址的 XML 节点的命名空间。
例外
writer
或 addressingVersion
或 localName
或 ns
为 null
。
示例
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。
- localNamelocalname
- String
要包含终结点地址的 XML 节点的本地名称。
- ns
- String
XmlDictionaryString,其中包含要包含终结点地址的 XML 节点的命名空间。
例外
writer
或 addressingVersion
或 localName
或 ns
为 null
。
示例
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();