MetadataExchangeClient MetadataExchangeClient MetadataExchangeClient MetadataExchangeClient Class

Definition

Downloads service metadata.

public ref class MetadataExchangeClient
public class MetadataExchangeClient
type MetadataExchangeClient = class
Public Class MetadataExchangeClient
Inheritance
MetadataExchangeClientMetadataExchangeClientMetadataExchangeClientMetadataExchangeClient

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 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:

Constructors

MetadataExchangeClient() MetadataExchangeClient() MetadataExchangeClient() MetadataExchangeClient()

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(Binding) MetadataExchangeClient(Binding) MetadataExchangeClient(Binding) MetadataExchangeClient(Binding)

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

MetadataExchangeClient(EndpointAddress) MetadataExchangeClient(EndpointAddress) MetadataExchangeClient(EndpointAddress) MetadataExchangeClient(EndpointAddress)

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(String) MetadataExchangeClient(String) MetadataExchangeClient(String) MetadataExchangeClient(String)

Initializes a new instance of the MetadataExchangeClient class.

MetadataExchangeClient(Uri, MetadataExchangeClientMode) MetadataExchangeClient(Uri, MetadataExchangeClientMode) MetadataExchangeClient(Uri, MetadataExchangeClientMode) MetadataExchangeClient(Uri, MetadataExchangeClientMode)

Initializes a new instance of the MetadataExchangeClient class.

Properties

HttpCredentials HttpCredentials HttpCredentials HttpCredentials

Gets or sets the credentials used to make an HTTP/GET request.

MaximumResolvedReferences MaximumResolvedReferences MaximumResolvedReferences MaximumResolvedReferences

Gets or sets the maximum number of references to metadata that the MetadataExchangeClient downloads.

OperationTimeout OperationTimeout OperationTimeout OperationTimeout

Gets or sets the period of time within which the metadata must be downloaded before an exception is thrown.

ResolveMetadataReferences ResolveMetadataReferences ResolveMetadataReferences ResolveMetadataReferences

Gets or sets a value that controls whether references to metadata are resolved.

SoapCredentials SoapCredentials SoapCredentials SoapCredentials

Gets or sets the client security credentials used to make a WS-Transfer metadata request.

Methods

BeginGetMetadata(AsyncCallback, Object) BeginGetMetadata(AsyncCallback, Object) BeginGetMetadata(AsyncCallback, Object) BeginGetMetadata(AsyncCallback, Object)

Begins an asynchronous method call that returns a MetadataSet.

BeginGetMetadata(EndpointAddress, AsyncCallback, Object) BeginGetMetadata(EndpointAddress, AsyncCallback, Object) BeginGetMetadata(EndpointAddress, AsyncCallback, Object) BeginGetMetadata(EndpointAddress, AsyncCallback, Object)

Begins an asynchronous method call that returns a MetadataSet using the specified address, callback, and asynchronous state.

BeginGetMetadata(Uri, MetadataExchangeClientMode, AsyncCallback, Object) BeginGetMetadata(Uri, MetadataExchangeClientMode, AsyncCallback, Object) BeginGetMetadata(Uri, MetadataExchangeClientMode, AsyncCallback, Object) BeginGetMetadata(Uri, MetadataExchangeClientMode, AsyncCallback, Object)

Begins an asynchronous method call that returns a MetadataSet using the specified address, callback, asynchronous state, and download mechanism.

EndGetMetadata(IAsyncResult) EndGetMetadata(IAsyncResult) EndGetMetadata(IAsyncResult) EndGetMetadata(IAsyncResult)

Ends an asynchronous method call that returns a MetadataSet.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetChannelFactory(EndpointAddress, String, String) GetChannelFactory(EndpointAddress, String, String) GetChannelFactory(EndpointAddress, String, String) GetChannelFactory(EndpointAddress, String, String)

When overridden in a derived class, returns the channel factory that is used to make the WS-Transfer metadata request.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetMetadata() GetMetadata() GetMetadata() GetMetadata()

Returns a MetadataSet.

GetMetadata(EndpointAddress) GetMetadata(EndpointAddress) GetMetadata(EndpointAddress) GetMetadata(EndpointAddress)

Returns a MetadataSet from the specified address.

GetMetadata(EndpointAddress, Uri) GetMetadata(EndpointAddress, Uri) GetMetadata(EndpointAddress, Uri) GetMetadata(EndpointAddress, Uri)

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

GetMetadata(Uri, MetadataExchangeClientMode) GetMetadata(Uri, MetadataExchangeClientMode) GetMetadata(Uri, MetadataExchangeClientMode) GetMetadata(Uri, MetadataExchangeClientMode)

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

GetMetadataAsync() GetMetadataAsync() GetMetadataAsync() GetMetadataAsync()

Returns an asynchronous metadata set.

GetMetadataAsync(EndpointAddress) GetMetadataAsync(EndpointAddress) GetMetadataAsync(EndpointAddress) GetMetadataAsync(EndpointAddress)

Returns an asynchronous metadata set from the specified address.

GetMetadataAsync(EndpointAddress, Uri) GetMetadataAsync(EndpointAddress, Uri) GetMetadataAsync(EndpointAddress, Uri) GetMetadataAsync(EndpointAddress, Uri)

Returns an asynchronous metadata set from the specified address and on the specified route.

GetMetadataAsync(Uri, MetadataExchangeClientMode) GetMetadataAsync(Uri, MetadataExchangeClientMode) GetMetadataAsync(Uri, MetadataExchangeClientMode) GetMetadataAsync(Uri, MetadataExchangeClientMode)

Returns an asynchronous metadata set from the specified address using the specified download mode.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetWebRequest(Uri, String, String) GetWebRequest(Uri, String, String) GetWebRequest(Uri, String, String) GetWebRequest(Uri, String, String)

When overridden in a derived class, returns the HttpWebRequest used to make HTTP/GET metadata requests.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to