Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

DiscoveryClientResult Class

Represents the details of a discovery reference without the contents of the referenced document. This class cannot be inherited.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)
public sealed class DiscoveryClientResult
public final class DiscoveryClientResult
public final class DiscoveryClientResult
Not applicable.

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;
using System.Web.Services.Discovery;
public class MyDiscoveryClientResult
{
    static void Main()
    {
        try
        {
            DiscoveryClientProtocol myDiscoveryClientProtocol = 
                new DiscoveryClientProtocol();

            // Get the collection holding DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection = 
                myDiscoveryClientProtocol.ReadAll("results.discomap");
            Console.WriteLine("The number of DiscoveryClientResult objects: "
                + myDiscoveryClientResultCollection.Count);
            Console.WriteLine("Displaying the items in the collection:");

            // Iterate through the collection and display the properties
            // of each DiscoveryClientResult in it.
            foreach(DiscoveryClientResult myDiscoveryClientResult in 
                myDiscoveryClientResultCollection)
            {
                Console.WriteLine(
                    "Type of reference in the discovery document: "
                    + myDiscoveryClientResult.ReferenceTypeName);
                Console.WriteLine("Url for the reference: " 
                    + myDiscoveryClientResult.Url);
                Console.WriteLine("File for saving the reference: "
                    + myDiscoveryClientResult.Filename);
            }
        }
        catch(Exception e)
        {
            Console.WriteLine("Error is " + e.Message);
        }
    }
}

import System.*;
import System.Web.Services.Discovery.*;

public class MyDiscoveryClientResult
{
    public static void main(String[] args)
    {
        try {
            DiscoveryClientProtocol myDiscoveryClientProtocol = 
                new DiscoveryClientProtocol();

            // Get the collection holding DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection =
                myDiscoveryClientProtocol.ReadAll("results.discomap");

            Console.WriteLine("The number of DiscoveryClientResult objects: "
                + myDiscoveryClientResultCollection.get_Count());
            Console.WriteLine("Displaying the items in the collection:");
            DiscoveryClientResult myDiscoveryClientResult = null;
            // Iterate through the collection and display the properties
            // of each DiscoveryClientResult in it.
            for (int iCtr = 0; iCtr < myDiscoveryClientResultCollection.
                get_Count(); iCtr++) {
                myDiscoveryClientResult = myDiscoveryClientResultCollection.
                    get_Item(iCtr);
                Console.WriteLine("Type of reference in the discovery " 
                    + "document: " 
                    + myDiscoveryClientResult.get_ReferenceTypeName());
                Console.WriteLine("Url for the reference: " 
                    + myDiscoveryClientResult.get_Url());
                Console.WriteLine("File for saving the reference: " 
                    + myDiscoveryClientResult.get_Filename());
            }
        }
        catch (System.Exception e) {
            Console.WriteLine("Error is " + e.get_Message());
        }
    } //main
} //MyDiscoveryClientResult

System.Object
  System.Web.Services.Discovery.DiscoveryClientResult
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 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
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.