MetadataExchangeClient Class
TOC
Collapse the table of content
Expand the table of content

MetadataExchangeClient Class

 

Downloads service metadata.

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

System::Object
  System.ServiceModel.Description::MetadataExchangeClient

public ref class MetadataExchangeClient 

NameDescription
System_CAPS_pubmethodMetadataExchangeClient()

Initializes a new instance of the MetadataExchangeClient class.

System_CAPS_pubmethodMetadataExchangeClient(Binding^)

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

System_CAPS_pubmethodMetadataExchangeClient(EndpointAddress^)

Initializes a new instance of the MetadataExchangeClient class.

System_CAPS_pubmethodMetadataExchangeClient(String^)

Initializes a new instance of the MetadataExchangeClient class.

System_CAPS_pubmethodMetadataExchangeClient(Uri^, MetadataExchangeClientMode)

Initializes a new instance of the MetadataExchangeClient class.

NameDescription
System_CAPS_pubpropertyHttpCredentials

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

System_CAPS_pubpropertyMaximumResolvedReferences

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

System_CAPS_pubpropertyOperationTimeout

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

System_CAPS_pubpropertyResolveMetadataReferences

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

System_CAPS_pubpropertySoapCredentials

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

NameDescription
System_CAPS_pubmethodBeginGetMetadata(AsyncCallback^, Object^)

Begins an asynchronous method call that returns a MetadataSet.

System_CAPS_pubmethodBeginGetMetadata(EndpointAddress^, AsyncCallback^, Object^)

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

System_CAPS_pubmethodBeginGetMetadata(Uri^, MetadataExchangeClientMode, AsyncCallback^, Object^)

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

System_CAPS_pubmethodEndGetMetadata(IAsyncResult^)

Ends an asynchronous method call that returns a MetadataSet.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_protmethodGetChannelFactory(EndpointAddress^, String^, String^)

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

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetMetadata()

Returns a MetadataSet.

System_CAPS_pubmethodGetMetadata(EndpointAddress^)

Returns a MetadataSet from the specified address.

System_CAPS_pubmethodGetMetadata(EndpointAddress^, Uri^)

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

System_CAPS_pubmethodGetMetadata(Uri^, MetadataExchangeClientMode)

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

System_CAPS_pubmethodGetMetadataAsync()

Returns an asynchronous metadata set.

System_CAPS_pubmethodGetMetadataAsync(EndpointAddress^)

Returns an asynchronous metadata set from the specified address.

System_CAPS_pubmethodGetMetadataAsync(EndpointAddress^, Uri^)

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

System_CAPS_pubmethodGetMetadataAsync(Uri^, MetadataExchangeClientMode)

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

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodGetWebRequest(Uri^, String^, String^)

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

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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:

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft