This documentation is archived and is not being maintained.

DiscoveryClientReferenceCollection Class

Represents a collection of DiscoveryReference objects. This class cannot be inherited.

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

public ref class DiscoveryClientReferenceCollection sealed : public DictionaryBase

The References property of DiscoveryClientProtocol is of type DiscoveryClientReferenceCollection.

#using <System.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Net;
using namespace System::Collections;
using namespace System::Web::Services::Discovery;

int main()
{
   DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol;
   myDiscoveryClientProtocol->Credentials = CredentialCache::DefaultCredentials;

   // 'dataservice.vsdisco' is a sample discovery document.
   String^ myStringUrl = "http://localhost/dataservice.vsdisco";

   // Call the Discover method to populate the References property.
   DiscoveryDocument^ myDiscoveryDocument = myDiscoveryClientProtocol->Discover( myStringUrl );

   // Resolve all references found in the discovery document.
   myDiscoveryClientProtocol->ResolveAll();
   DiscoveryClientReferenceCollection^ myDiscoveryClientReferenceCollection = myDiscoveryClientProtocol->References;

   // Retrieve the keys from the collection.
   ICollection^ myCollection = myDiscoveryClientReferenceCollection->Keys;
   array<Object^>^myObjectCollection = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection->CopyTo( myObjectCollection, 0 );
   Console::WriteLine( "The discovery documents, service descriptions, and XML schema" );
   Console::WriteLine( " definitions in the collection are: " );
   for ( int i = 0; i < myObjectCollection->Length; i++ )
   {
      Console::WriteLine( myObjectCollection[ i ] );
   }
   Console::WriteLine( "" );

   // Retrieve the values from the collection.
   ICollection^ myCollection1 = myDiscoveryClientReferenceCollection->Values;
   array<Object^>^myObjectCollection1 = gcnew array<Object^>(myDiscoveryClientReferenceCollection->Count);
   myCollection1->CopyTo( myObjectCollection1, 0 );
   Console::WriteLine( "The objects in the collection are: " );
   for ( int i = 0; i < myObjectCollection1->Length; i++ )
   {
      Console::WriteLine( myObjectCollection1[ i ] );
   }
   Console::WriteLine( "" );
   String^ myStringUrl1 = "http://localhost/dataservice.vsdisco";
   if ( myDiscoveryClientReferenceCollection->Contains( myStringUrl1 ) )
   {
      Console::WriteLine( "The document reference {0} is part of the collection.", myStringUrl1 );
   }
}
#using <mscorlib.dll>
#using <System.dll>
#using <System.Web.Services.dll>
using namespace System;
using namespace System::Net;
using namespace System::Collections;
using namespace System::Web::Services::Discovery;

int main() {
   DiscoveryClientProtocol* myDiscoveryClientProtocol =
      new DiscoveryClientProtocol();

   myDiscoveryClientProtocol->Credentials =
      CredentialCache::DefaultCredentials;

   // 'dataservice.vsdisco' is a sample discovery document.
   String* myStringUrl = S"http://localhost/dataservice.vsdisco";

   // Call the Discover method to populate the References property.
   DiscoveryDocument* myDiscoveryDocument =
      myDiscoveryClientProtocol->Discover(myStringUrl);

   // Resolve all references found in the discovery document.
   myDiscoveryClientProtocol->ResolveAll();

   DiscoveryClientReferenceCollection* myDiscoveryClientReferenceCollection =
      myDiscoveryClientProtocol->References;

   // Retrieve the keys from the collection.
   ICollection* myCollection = myDiscoveryClientReferenceCollection->Keys;
   Object* myObjectCollection[] =
      new Object*[myDiscoveryClientReferenceCollection->Count];
   myCollection->CopyTo(myObjectCollection, 0);

   Console::WriteLine(S"The discovery documents, service descriptions, and XML schema");
   Console::WriteLine(S" definitions in the collection are: ");
   for (int i=0; i< myObjectCollection->Length; i++) {
      Console::WriteLine(myObjectCollection->Item[i]);
   }
   Console::WriteLine(S"");

   // Retrieve the values from the collection.
   ICollection* myCollection1 = myDiscoveryClientReferenceCollection->Values;
   Object* myObjectCollection1[] =
      new Object*[myDiscoveryClientReferenceCollection->Count];
   myCollection1->CopyTo(myObjectCollection1, 0);

   Console::WriteLine(S"The objects in the collection are: ");
   for (int i=0; i< myObjectCollection1->Length; i++) {
      Console::WriteLine(myObjectCollection1->Item[i]);
   }

   Console::WriteLine(S"");

   String* myStringUrl1 = S"http://localhost/dataservice.vsdisco";
   if (myDiscoveryClientReferenceCollection->Contains(myStringUrl1)) {
      Console::WriteLine(S"The document reference {0} is part of the collection.",
         myStringUrl1);
   }
}

System::Object
  System.Collections::DictionaryBase
    System.Web.Services.Discovery::DiscoveryClientReferenceCollection

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 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: