DiscoveryClientDocumentCollection Class

Represents a collection of documents discovered during XML Web services discovery that have been downloaded to the client. This class cannot be inherited.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in

public sealed class DiscoveryClientDocumentCollection : DictionaryBase
public final class DiscoveryClientDocumentCollection extends DictionaryBase
public final class DiscoveryClientDocumentCollection extends DictionaryBase
Not applicable.

The Documents property of DiscoveryClientProtocol is of type DiscoveryClientDocumentCollection.

The following code example enacts XML Web service discovery and downloads the discovered documents to the client. The names of the discovery documents within the DiscoveryClientDocumentCollection are output to the console.

using System;
using System.Net;
using System.IO;
using System.Collections;
using System.Security.Permissions;
using System.Web.Services.Discovery;

class DiscoveryClientDocumentCollectionSample
   static void Main()

   [PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")]
   static void Run()
      DiscoveryClientProtocol myDiscoveryClientProtocol =
         new DiscoveryClientProtocol();
      myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials;

      // 'dataservice.disco' is a sample discovery document.
      string myStringUrl = "http://localhost/dataservice.disco";
      // 'Discover' method is called to populate the 'Documents' property.
      DiscoveryDocument myDiscoveryDocument = 

      // An instance of the 'DiscoveryClientDocumentCollection' class is created.
      DiscoveryClientDocumentCollection myDiscoveryClientDocumentCollection = 
      // 'Keys' in the collection are retrieved.
      ICollection myCollection = myDiscoveryClientDocumentCollection.Keys;
      object[] myObjectCollection = 
         new object[myDiscoveryClientDocumentCollection.Count];
      myCollection.CopyTo(myObjectCollection, 0);
      Console.WriteLine("The discovery documents in the collection are :");
      for (int iIndex=0; iIndex < myObjectCollection.Length; iIndex++)

      // 'Values' in the collection are retrieved.
      ICollection myCollection1 = myDiscoveryClientDocumentCollection.Values;
      object[] myObjectCollection1 = 
         new object[myDiscoveryClientDocumentCollection.Count];
      myCollection1.CopyTo(myObjectCollection1, 0);
      Console.WriteLine("The objects in the collection are :");
      for (int iIndex=0; iIndex < myObjectCollection1.Length; iIndex++)


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

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0