DiscoveryClientResult Class
Represents the details of a discovery reference without the contents of the referenced document. This class cannot be inherited.
Assembly: System.Web.Services (in System.Web.Services.dll)
Using the WriteAll method of DiscoveryClientProtocol, all valid referenced documents and a file containing a map of all save documents can be written to disk. The file containing a map of all saved documents contains the details of each document as summarized by the properties of DiscoveryClientResult.
After the referenced documents and the map of the referenced documents have been written to disk using the WriteAll method, you can invoke the ReadAll method to read the discovery documents.
#using <System.Web.Services.dll> #using <System.dll> using namespace System; using namespace System::Web::Services::Discovery; int main() { try { DiscoveryClientProtocol^ myDiscoveryClientProtocol = gcnew DiscoveryClientProtocol; // Get the collection holding DiscoveryClientResult objects. DiscoveryClientResultCollection^ myDiscoveryClientResultCollection = myDiscoveryClientProtocol->ReadAll( "results.discomap" ); Console::WriteLine( "The number of DiscoveryClientResult objects: {0}", myDiscoveryClientResultCollection->Count ); Console::WriteLine( "Displaying the items in the collection:" ); // Iterate through the collection and display the properties // of each DiscoveryClientResult in it. System::Collections::IEnumerator^ myEnum = myDiscoveryClientResultCollection->GetEnumerator(); while ( myEnum->MoveNext() ) { DiscoveryClientResult^ myDiscoveryClientResult = safe_cast<DiscoveryClientResult^>(myEnum->Current); Console::WriteLine( "Type of reference in the discovery document: {0}", myDiscoveryClientResult->ReferenceTypeName ); Console::WriteLine( "Url for the reference: {0}", myDiscoveryClientResult->Url ); Console::WriteLine( "File for saving the reference: {0}", myDiscoveryClientResult->Filename ); } } catch ( Exception^ e ) { Console::WriteLine( "Error is {0}", e->Message ); } }
#using <mscorlib.dll>
#using <System.Web.Services.dll>
#using <System.dll>
using namespace System;
using namespace System::Web::Services::Discovery;
int main()
{
try
{
DiscoveryClientProtocol* myDiscoveryClientProtocol =
new DiscoveryClientProtocol();
// Get the collection holding DiscoveryClientResult objects.
DiscoveryClientResultCollection* myDiscoveryClientResultCollection =
myDiscoveryClientProtocol->ReadAll(S"results.discomap");
Console::WriteLine(S"The number of DiscoveryClientResult objects: {0}", __box(myDiscoveryClientResultCollection->Count));
Console::WriteLine(S"Displaying the items in the collection:");
// Iterate through the collection and display the properties
// of each DiscoveryClientResult in it.
System::Collections::IEnumerator* myEnum = myDiscoveryClientResultCollection->GetEnumerator();
while (myEnum->MoveNext())
{
DiscoveryClientResult* myDiscoveryClientResult = __try_cast<DiscoveryClientResult*>(myEnum->Current);
Console::WriteLine(
S"Type of reference in the discovery document: {0}", myDiscoveryClientResult->ReferenceTypeName);
Console::WriteLine(S"Url for the reference: {0}", myDiscoveryClientResult->Url);
Console::WriteLine(S"File for saving the reference: {0}", myDiscoveryClientResult->Filename);
}
}
catch(Exception* e)
{
Console::WriteLine(S"Error is {0}", e->Message);
}
}
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.