MetadataReference 類別

定義

表示從中繼資料交換端點傳回之中繼資料文件的參考。Represents a reference to a metadata document returned from a metadata exchange endpoint.

public ref class MetadataReference : System::Xml::Serialization::IXmlSerializable
public class MetadataReference : System.Xml.Serialization.IXmlSerializable
type MetadataReference = class
    interface IXmlSerializable
Public Class MetadataReference
Implements IXmlSerializable
繼承
MetadataReference
實作

備註

使用 Windows Communication Foundation (WCF) 時, 可以為任何服務建立中繼資料端點。When using Windows Communication Foundation (WCF), a metadata endpoint can be created for any service. 您可以查詢中繼資料的端點,以允許用戶端與端點通訊。The endpoint can be queried for metadata that allows a client to communicate with the endpoint. 例如,中繼資料端點可以傳回描述服務的方法和資料型別的 Web 服務描述語言 (WSDL) 文件。For example, a metadata endpoint can return a Web Services Description Language (WSDL) document that describes the methods and data types of a service.

類別會與透過 ws-metadataexchange 回應搭配使用, 其中參考會直接編碼為<mex:MetadataReference><mex:MetadataLocation>MetadataReferenceThe MetadataReference class is used with WS-MetadataExchange responses where references are directly encoded as <mex:MetadataReference> or <mex:MetadataLocation>.

中繼資料文件可以參考很多其他描述型別的文件,而這些文件甚至可以包含更多的參考。Metadata documents can reference many other documents that describe types and those documents can contain even more references. MetadataReference 類別代表單一端點,這個端點會傳回本身可包含多個 WSDL 或 XSD 項目,以及對其他 WS-MetadataExchange 端點之中繼資料參考的文件。The MetadataReference class represents a single endpoint that returns a document that can itself contain multiple WSDL or XSD items as well as other metadata references to other WS-MetadataExchange endpoints.

處理表示總中繼資料交換點的 MetadataReference 時,通常會使用 MetadataSet 類別的執行個體。Instances of the MetadataReference class are commonly used when processing a MetadataSet, which represents the total metadata exchange point. MetadataResolver 類別是針對解析所有用於傳回中繼資料的參考而設計。The MetadataResolver class is designed to resolve all references used to return the metadata. 但是,如果您需要檢查每個參考,請使用 MetadataReference 類別來表示每個端點。If, however, you need to examine each reference, use the MetadataReference class to represent each endpoint.

規格Specifications

WCF 會執行 Web 服務中繼資料交換 (WS-透過 ws-metadataexchange) 規格, 以傳回中繼資料。WCF implements the Web Services Metadata Exchange (WS-MetadataExchange) specification for returning metadata. 該規格會進一步使用 Web 服務傳輸 (WS-Transfer) 規格來定義用於擷取 XML 資料的機制。That specification further uses the Web Services Transfer (WS-Transfer) specification to define the mechanism for retrieving XML-based data.

建構函式

MetadataReference()

初始化 MetadataReference 類別的新執行個體。Initializes a new instance of the MetadataReference class.

MetadataReference(EndpointAddress, AddressingVersion)

初始化 MetadataReference 類別的新執行個體,並且指定端點的網路位址和位址版本。Initializes a new instance of the MetadataReference class and specifies the network address and address version of the endpoint.

屬性

Address

取得或設定傳回中繼資料之服務的網路位址。Gets or sets the network address of a service that returns metadata.

AddressVersion

取得或設定端點中實作或使用的版本。Gets or sets the version implemented in, or used by the endpoint.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

IXmlSerializable.GetSchema()

傳回用於中繼資料參考端點的 XML 結構描述文件。Returns an XML schema document for the metadata reference endpoint.

IXmlSerializable.ReadXml(XmlReader)

使用所提供的讀取器物件進行讀取。Reads using the supplied reader object.

IXmlSerializable.WriteXml(XmlWriter)

使用指定的寫入器物件寫入 XML 資料流。Writes an XML stream with the specified writer object.

適用於