Editar

Compartir vía


IMetadataExchange Interface

Definition

Exposes methods used to return metadata about a service.

public interface class IMetadataExchange
[System.ServiceModel.ServiceContract(ConfigurationName="IMetadataExchange", Name="IMetadataExchange", Namespace="http://schemas.microsoft.com/2006/04/mex")]
public interface IMetadataExchange
[<System.ServiceModel.ServiceContract(ConfigurationName="IMetadataExchange", Name="IMetadataExchange", Namespace="http://schemas.microsoft.com/2006/04/mex")>]
type IMetadataExchange = interface
Public Interface IMetadataExchange
Attributes

Remarks

When programming Windows Communication Foundation (WCF) services, it is useful to publish metadata about the service. For example, metadata can be a Web Services Description Language (WSDL) document that describes all of the methods and data types employed by a service. Returning metadata about an WCF service allows consumers of a service to easily create clients for the service. For more information about WCF metadata endpoints, see Metadata.

Services implemented using WCF publish metadata by exposing one or more metadata endpoints. Metadata endpoints in WCF have an address, a binding and a contract like any other endpoint. The MetadataReference interface specifies the service contract implemented by all metadata endpoints in WCF.

There is no need to implement the MetadataReference contract in your service implementation. Instead, add the ServiceMetadataBehavior to the service description.

Or, when using configuration, set the contract attribute of the endpoint element to IMetadataExchange. For an example, see How to: Publish Metadata for a Service Using a Configuration File.

For details on publishing metadata in WCF see Publishing Metadata.

Methods

BeginGet(Message, AsyncCallback, Object)

Starts an asynchronous retrieval of metadata.

EndGet(IAsyncResult)

Concludes the retrieval of metadata.

Get(Message)

Returns the service metadata.

Applies to

See also