Export (0) Print
Expand All

DiscoveryClientProtocol.ReadAll Method

Reads in a file containing a map of saved discovery documents populating the Documents and References properties, with discovery documents, XML Schema Definition (XSD) schemas, and service descriptions referenced in the file.

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

public DiscoveryClientResultCollection ReadAll (
	string topLevelFilename
)
public DiscoveryClientResultCollection ReadAll (
	String topLevelFilename
)
public function ReadAll (
	topLevelFilename : String
) : DiscoveryClientResultCollection
Not applicable.

Parameters

topLevelFilename

Name of file to read in, containing the map of saved discovery documents.

Return Value

A DiscoveryClientResultCollection containing the results found in the file with the map of saved discovery documents. The file format is a DiscoveryClientProtocol.DiscoveryClientResultsFile class serialized into XML; however, one would typically create the file using only the WriteAll method or Disco.exe.

A file containing a map of saved discovery documents can be created by the WriteAll method or Disco.exe.

The topLevelFilename parameter must include the fully qualified path if the file does not exist in the current directory.

The following code example is a Web Form that populates a DataGrid with the details about the documents and references found in an existing discovery map document using the ReadAll method.

 protected void Discover_Click(object Source, EventArgs e)
 {
  // Specify the URL to read the discovery results from.
  string outputDirectory = DiscoDir.Text;

      DiscoveryClientProtocol client = new DiscoveryClientProtocol();
  // Use default credentials to access the files containing the discovery results.
      client.Credentials = CredentialCache.DefaultCredentials;

      try {
           DiscoveryDocument doc;
    // Read in existing discovery results.
        DiscoveryClientResultCollection results = client.ReadAll(Path.Combine(DiscoDir.Text,"results.discomap"));
      }
      catch ( Exception e2) 
      {
        DiscoveryResultsGrid.Columns.Clear();
        Status.Text = e2.Message;
      }
  // If discovery documents existed in the supplied folder, display the results in a data grid.
      if (client.Documents.Count > 0)
      PopulateGrid(client);
}

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

Community Additions

ADD
Show:
© 2014 Microsoft