This documentation is archived and is not being maintained.
DiscoveryClientResultCollection Class
Visual Studio 2008
Contains a collection of DiscoveryClientResult objects. This class cannot be inherited.
Assembly: System.Web.Services (in System.Web.Services.dll)
#using <System.Xml.dll> #using <System.Web.Services.dll> #using <System.dll> using namespace System; using namespace System::Reflection; using namespace System::IO; using namespace System::Web::Services::Discovery; using namespace System::Xml::Schema; using namespace System::Collections; int main() { try { DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol; // Get the collection of DiscoveryClientResult objects. DiscoveryClientResultCollection^ myDiscoveryClientResultCollection = myDiscoveryClientProtocol->ReadAll( "results.discomap" ); Console::WriteLine( "Removing a DiscoveryClientResult from the collection..." ); // Remove the first DiscoveryClientResult from the collection. myDiscoveryClientResultCollection->Remove( myDiscoveryClientResultCollection[ 0 ] ); Console::WriteLine( "Adding a DiscoveryClientResult to the collection..." ); DiscoveryClientResult^ myDiscoveryClientResult = gcnew DiscoveryClientResult; // Set the DiscoveryDocumentReference class as the type of // reference in the discovery document. myDiscoveryClientResult->ReferenceTypeName = "System.Web.Services.Discovery.DiscoveryDocumentReference"; // Set the URL for the reference. myDiscoveryClientResult->Url = "http://localhost/Discovery/Service1_cs.asmx?disco"; // Set the name of the file in which the reference is saved. myDiscoveryClientResult->Filename = "Service1_cs.disco"; // Add myDiscoveryClientResult to the collection. myDiscoveryClientResultCollection->Add( myDiscoveryClientResult ); if ( myDiscoveryClientResultCollection->Contains( myDiscoveryClientResult ) ) { Console::WriteLine( "Instance of DiscoveryClientResult found in the Collection" ); } } catch ( Exception^ ex ) { Console::WriteLine( "Error is {0}", ex->Message ); } }
#using <mscorlib.dll>
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Reflection;
using namespace System::IO;
using namespace System::Web::Services::Discovery;
using namespace System::Xml::Schema;
using namespace System::Collections;
int main()
{
try
{
DiscoveryClientProtocol* myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the collection of DiscoveryClientResult objects.
DiscoveryClientResultCollection* myDiscoveryClientResultCollection =
myDiscoveryClientProtocol->ReadAll(S"results.discomap");
Console::WriteLine(
S"Removing a DiscoveryClientResult from the collection...");
// Remove the first DiscoveryClientResult from the collection.
myDiscoveryClientResultCollection->Remove(
myDiscoveryClientResultCollection->Item[0]);
Console::WriteLine(S"Adding a DiscoveryClientResult to the collection...");
DiscoveryClientResult* myDiscoveryClientResult =
new DiscoveryClientResult();
// Set the DiscoveryDocumentReference class as the type of
// reference in the discovery document.
myDiscoveryClientResult->ReferenceTypeName =
S"System.Web.Services.Discovery.DiscoveryDocumentReference";
// Set the URL for the reference.
myDiscoveryClientResult->Url =
S"http://localhost/Discovery/Service1_cs.asmx?disco";
// Set the name of the file in which the reference is saved.
myDiscoveryClientResult->Filename = S"Service1_cs.disco";
// Add myDiscoveryClientResult to the collection.
myDiscoveryClientResultCollection->Add(myDiscoveryClientResult);
if(myDiscoveryClientResultCollection->Contains(myDiscoveryClientResult))
{
Console::WriteLine(
S"Instance of DiscoveryClientResult found in the Collection");
}
}
catch(Exception* ex)
{
Console::WriteLine(S"Error is {0}", ex->Message);
}
}
System::Object
System.Collections::CollectionBase
System.Web.Services.Discovery::DiscoveryClientResultCollection
System.Collections::CollectionBase
System.Web.Services.Discovery::DiscoveryClientResultCollection
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.
Show: