MetadataExchangeClient.GetMetadata Method

Definition

Overloads

GetMetadata(Uri, MetadataExchangeClientMode)

Returns a MetadataSet from the specified address using the specified download mode.

GetMetadata(EndpointAddress, Uri)

Returns a MetadataSet from the specified address and on the specified route.

GetMetadata(EndpointAddress)

Returns a MetadataSet from the specified address.

GetMetadata()

Returns a MetadataSet.

GetMetadata(Uri, MetadataExchangeClientMode)

Returns a MetadataSet from the specified address using the specified download mode.

public System.ServiceModel.Description.MetadataSet GetMetadata (Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode);
Parameters
address
Uri

The address from which to download the metadata.

mode
MetadataExchangeClientMode

The download mechanism to use.

Returns

The metadata that is downloaded.

Remarks

Use this method to specify the address and whether to use HTTP GET or WS-Transfer Get to download the metadata.

GetMetadata(EndpointAddress, Uri)

Returns a MetadataSet from the specified address and on the specified route.

public System.ServiceModel.Description.MetadataSet GetMetadata (System.ServiceModel.EndpointAddress address, Uri via);
Parameters
address
EndpointAddress

The address from which to download the metadata.

via
Uri

The URI address that represents the route a message takes.

Returns

The metadata that is downloaded.

GetMetadata(EndpointAddress)

Returns a MetadataSet from the specified address.

public System.ServiceModel.Description.MetadataSet GetMetadata (System.ServiceModel.EndpointAddress address);
Parameters
address
EndpointAddress

The address from which to download the metadata.

Returns

The metadata located at the address.

GetMetadata()

Returns a MetadataSet.

public System.ServiceModel.Description.MetadataSet GetMetadata ();
Returns

The MetadataSet that contains the downloaded metadata.

Examples

The following code example shows the use of MetadataExchangeClient to specify a download binding, resolve any contained references to metadata, and download the metadata.

// Get metadata documents.
Console.WriteLine("URI of the metadata documents retreived:");
MetadataExchangeClient metaTransfer
  = new MetadataExchangeClient(httpGetMetaAddress.Uri, MetadataExchangeClientMode.HttpGet);
metaTransfer.ResolveMetadataReferences = true;
MetadataSet otherDocs = metaTransfer.GetMetadata();
foreach (MetadataSection doc in otherDocs.MetadataSections)
    Console.WriteLine(doc.Dialect + " : " + doc.Identifier);