MetadataExchangeClient.GetMetadata Method ()

 

Returns a MetadataSet.

Namespace:   System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public MetadataSet GetMetadata()

Return Value

Type: System.ServiceModel.Description.MetadataSet

The MetadataSet that contains the downloaded metadata.

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);

.NET Framework
Available since 3.0
Return to top
Show: