MetadataExchangeClient Constructors

Definition

Initializes a new instance of the MetadataExchangeClient class.

Overloads

MetadataExchangeClient()

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(Binding)

Initializes a new instance of the MetadataExchangeClient class using the specified binding.

MetadataExchangeClient(EndpointAddress)

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(String)

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(Uri, MetadataExchangeClientMode)

Initializes a new instance of the MetadataExchangeClient class.

Remarks

The following table lists the default bindings that are used for various protocol schemes.

MetadataExchangeClient()

Initializes a new instance of the MetadataExchangeClient class.

public MetadataExchangeClient ();

Applies to

.NET Framework 4.8.1 e altre versioni
Prodotto Versioni
.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

MetadataExchangeClient(Binding)

Initializes a new instance of the MetadataExchangeClient class using the specified binding.

public MetadataExchangeClient (System.ServiceModel.Channels.Binding mexBinding);

Parameters

mexBinding
Binding

The binding to use when retrieving metadata using WS-Transfer.

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

Remarks

Use this constructor to specify a binding to use when downloading metadata.

Applies to

.NET Framework 4.8.1 e altre versioni
Prodotto Versioni
.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

MetadataExchangeClient(EndpointAddress)

Initializes a new instance of the MetadataExchangeClient class.

public MetadataExchangeClient (System.ServiceModel.EndpointAddress address);

Parameters

address
EndpointAddress

The metadata address.

Remarks

Use this constructor to specify the address of the metadata endpoint.

Applies to

.NET Framework 4.8.1 e altre versioni
Prodotto Versioni
.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

MetadataExchangeClient(String)

Initializes a new instance of the MetadataExchangeClient class.

public MetadataExchangeClient (string endpointConfigurationName);

Parameters

endpointConfigurationName
String

The name of the endpoint configuration information to use when downloading metadata.

Remarks

Use this constructor to use the data from a specific endpoint configuration element to create a channel to download the metadata.

Applies to

.NET Framework 4.8.1 e altre versioni
Prodotto Versioni
.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

MetadataExchangeClient(Uri, MetadataExchangeClientMode)

Initializes a new instance of the MetadataExchangeClient class.

public MetadataExchangeClient (Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode);

Parameters

address
Uri

The address of the metadata.

mode
MetadataExchangeClientMode

The mode to use when downloading the 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);

Remarks

Use this constructor to specify the address and whether to use an HTTP GET request or WS-Transfer Get. For more information, see System.ServiceModel.Description.MetadataExchangeClientMode.

Applies to

.NET Framework 4.8.1 e altre versioni
Prodotto Versioni
.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