Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DiscoveryClientResult Class

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

The DiscoveryClientResult type exposes the following members.

Public methodDiscoveryClientResult()Initializes a new instance of the DiscoveryClientResult class.
Public methodDiscoveryClientResult(Type, String, String)Initializes a new instance of the DiscoveryClientResult class and sets the ReferenceTypeName property to referenceType, the Url property to url and the Filename property to filename.

Public propertyFilenameGets or sets the name of the file in which the reference is saved.
Public propertyReferenceTypeNameName of the class representing the type of reference in the discovery document.
Public propertyUrlGets or sets the URL for the reference.

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

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()
            DiscoveryClientProtocol myDiscoveryClientProtocol = 
                new DiscoveryClientProtocol();

            // Get the collection holding DiscoveryClientResult objects.
            DiscoveryClientResultCollection myDiscoveryClientResultCollection = 
            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 
                    "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);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft