DiscoveryClientProtocol::DiscoveryClientResultsFile Class
Represents the root element of an XML document containing the results of all files written when the WriteAll method is invoked.
Assembly: System.Web.Services (in System.Web.Services.dll)
The DiscoveryClientProtocol::DiscoveryClientResultsFile type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | DiscoveryClientProtocol::DiscoveryClientResultsFile | Initializes a new instance of the DiscoveryClientProtocol::DiscoveryClientResultsFile class. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
When you invoke the DiscoveryClientProtocol::WriteAll method, all resolved discovery documents and a file containing a map of all those files are saved to a directory. The map file is described in XML with the root element being DiscoveryClientProtocol::DiscoveryClientResultsFile; this class is passed to the XmlSerializer class to serialize the results.
#using <System.Xml.dll> #using <System.Web.Services.dll> #using <System.dll> using namespace System; using namespace System::Web::Services::Discovery; using namespace System::Net; using namespace System::Xml; using namespace System::Xml::Serialization; int main() { String^ outputDirectory = "c:\\InetPub\\wwwroot"; DiscoveryClientProtocol^ myClient = gcnew DiscoveryClientProtocol; // Use default credentials to access the URL being discovered. myClient->Credentials = CredentialCache::DefaultCredentials; try { DiscoveryDocument^ myDocument; // Discover the supplied URL to determine if it is a discovery document. myDocument = myClient->Discover( "http://localhost/MathService_cs.vsdisco" ); myClient->ResolveAll(); DiscoveryClientResultCollection^ myCollection = myClient->WriteAll( outputDirectory, "MyDiscoMap.discomap" ); // Get the DiscoveryClientProtocol.DiscoveryClientResultsFile. DiscoveryClientProtocol::DiscoveryClientResultsFile ^ myResultFile = gcnew DiscoveryClientProtocol::DiscoveryClientResultsFile; XmlSerializer^ mySerializer = gcnew XmlSerializer( myResultFile->GetType() ); XmlReader^ reader = gcnew XmlTextReader( "http://localhost/MyDiscoMap.discomap" ); myResultFile = dynamic_cast<DiscoveryClientProtocol::DiscoveryClientResultsFile^>(mySerializer->Deserialize( reader )); // Get a collection of DiscoveryClientResult objects. DiscoveryClientResultCollection^ myResultcollection = myResultFile->Results; Console::WriteLine( "Referred file(s): " ); System::Collections::IEnumerator^ myEnum = myResultcollection->GetEnumerator(); while ( myEnum->MoveNext() ) { DiscoveryClientResult^ myResult = safe_cast<DiscoveryClientResult^>(myEnum->Current); Console::WriteLine( myResult->Filename ); } } catch ( Exception^ e ) { Console::WriteLine( e->Message ); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


