MetadataExchangeClient Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Downloads service metadata.
public ref class MetadataExchangeClient
public class MetadataExchangeClient
type MetadataExchangeClient = class
Public Class MetadataExchangeClient
- Inheritance
-
MetadataExchangeClient
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);
Use the MetadataExchangeClient to download metadata. Typically, a MetadataExchangeClient is configured for a metadata request and then passed to the MetadataResolver.Resolve or MetadataResolver.Resolve method for the MetadataResolver to use to download metadata.
However, you can use the MetadataExchangeClient directly to retrieve metadata as a MetadataSet that contains MetadataSection objects.
Whether used directly or passed to a MetadataResolver, MetadataExchangeClient has the following members to control the metadata download process:
Use the constructors to customize the binding to use when making the metadata request.
Use the HttpCredentials property to specify the credentials used to make an HTTP/GET request.
Use the SoapCredentials property to specify the credentials used to make a WS-Transfer metadata request.
Use the MaximumResolvedReferences property to limit the number of metadata references the MetadataExchangeClient resolves.
Use the OperationTimeout property to limit the time spent retrieving metadata.
Use the ResolveMetadataReferences property to specify whether to locate and retrieve other metadata documents referred to by the metadata downloaded from the original metadata endpoint.
Use the GetMetadata methods to begin the downloading process.
In addition, you can create a derived class that can override the following two protected methods:
Override the GetChannelFactory method to modify the channel that makes a metadata request using WS-Transfer.
Override the GetWebRequest method to modify the HttpWebRequest that makes a metadata request using HTTP/GET.
Metadata |
Initializes a new instance of the MetadataExchangeClient class. |
Metadata |
Initializes a new instance of the MetadataExchangeClient class using the specified binding. |
Metadata |
Initializes a new instance of the MetadataExchangeClient class. |
Metadata |
Initializes a new instance of the MetadataExchangeClient class. |
Metadata |
Initializes a new instance of the MetadataExchangeClient class. |
Http |
Gets or sets the credentials used to make an HTTP/GET request. |
Maximum |
Gets or sets the maximum number of references to metadata that the MetadataExchangeClient downloads. |
Operation |
Gets or sets the period of time within which the metadata must be downloaded before an exception is thrown. |
Resolve |
Gets or sets a value that controls whether references to metadata are resolved. |
Soap |
Gets or sets the client security credentials used to make a WS-Transfer metadata request. |
Begin |
Begins an asynchronous method call that returns a MetadataSet. |
Begin |
Begins an asynchronous method call that returns a MetadataSet using the specified address, callback, and asynchronous state. |
Begin |
Begins an asynchronous method call that returns a MetadataSet using the specified address, callback, asynchronous state, and download mechanism. |
End |
Ends an asynchronous method call that returns a MetadataSet. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
Get |
When overridden in a derived class, returns the channel factory that is used to make the WS-Transfer metadata request. |
Get |
Serves as the default hash function. (Inherited from Object) |
Get |
Returns a MetadataSet. |
Get |
Returns a MetadataSet from the specified address and on the specified route. |
Get |
Returns a MetadataSet from the specified address. |
Get |
Returns a MetadataSet from the specified address using the specified download mode. |
Get |
Returns an asynchronous metadata set. |
Get |
Returns an asynchronous metadata set from the specified address and on the specified route. |
Get |
Returns an asynchronous metadata set from the specified address. |
Get |
Returns an asynchronous metadata set from the specified address using the specified download mode. |
Get |
Gets the Type of the current instance. (Inherited from Object) |
Get |
When overridden in a derived class, returns the HttpWebRequest used to make HTTP/GET metadata requests. |
Memberwise |
Creates a shallow copy of the current Object. (Inherited from Object) |
To |
Returns a string that represents the current object. (Inherited from Object) |
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 |
Feedback su .NET
.NET è un progetto di open source. Selezionare un collegamento per fornire feedback: