MetadataExchangeClient.GetMetadata Method

Definition

Returns a MetadataSet.

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.

C#
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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetMetadata(EndpointAddress, Uri)

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

C#
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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetMetadata(EndpointAddress)

Returns a MetadataSet from the specified address.

C#
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.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetMetadata()

Returns a MetadataSet.

C#
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.

C#
// 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);

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1