Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DiscoveryClientResultCollection Class

Contains a collection of DiscoveryClientResult objects. This class cannot be inherited.

Namespace: System.Web.Services.Discovery
Assembly: System.Web.Services (in system.web.services.dll)
public sealed class DiscoveryClientResultCollection : CollectionBase
public final class DiscoveryClientResultCollection extends CollectionBase
public final class DiscoveryClientResultCollection extends CollectionBase
Not applicable.
using System;
using System.Reflection;
using System.IO;
using System.Web.Services.Discovery;
using System.Xml.Schema;
using System.Collections;

public class MyDiscoveryClientResult
{
   static void Main()
   {
      try
      {
         DiscoveryClientProtocol myDiscoveryClientProtocol = 
             new DiscoveryClientProtocol();

         // Get the collection of DiscoveryClientResult objects.
         DiscoveryClientResultCollection myDiscoveryClientResultCollection =
             myDiscoveryClientProtocol.ReadAll("results.discomap");
         Console.WriteLine(
             "Removing a DiscoveryClientResult from the collection...");

         // Remove the first DiscoveryClientResult from the collection.
         myDiscoveryClientResultCollection.Remove(
             myDiscoveryClientResultCollection[0]);
         Console.WriteLine("Adding a DiscoveryClientResult" +
             " to the collection...");
         DiscoveryClientResult myDiscoveryClientResult = 
             new DiscoveryClientResult();

         // Set the DiscoveryDocumentReference class as the type of 
         // reference in the discovery document.
         myDiscoveryClientResult.ReferenceTypeName = 
             "System.Web.Services.Discovery.DiscoveryDocumentReference";

         // Set the URL for the reference.
         myDiscoveryClientResult.Url = 
             "http://localhost/Discovery/Service1_cs.asmx?disco";

         // Set the name of the file in which the reference is saved.
         myDiscoveryClientResult.Filename = "Service1_cs.disco";

         // Add myDiscoveryClientResult to the collection.
         myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
         if(myDiscoveryClientResultCollection.Contains(myDiscoveryClientResult))
         {
            Console.WriteLine(
                "Instance of DiscoveryClientResult found in the Collection");
         }
      }
      catch(Exception ex)
      {
         Console.WriteLine("Error is "+ex.Message);
      }
   }
}

import System.*;
import System.Reflection.*;
import System.IO.*;
import System.Web.Services.Discovery.*;
import System.Xml.Schema.*;
import System.Collections.*;

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

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

            Console.WriteLine("Removing a DiscoveryClientResult from the "
                + "collection...");

            // Remove the first DiscoveryClientResult from the collection.
            myDiscoveryClientResultCollection.Remove(
                myDiscoveryClientResultCollection.get_Item(0));
            Console.WriteLine("Adding a DiscoveryClientResult" 
                + " to the collection...");

            DiscoveryClientResult myDiscoveryClientResult = 
                new DiscoveryClientResult();

            // Set the DiscoveryDocumentReference class as the type of 
            // reference in the discovery document.
            myDiscoveryClientResult.set_ReferenceTypeName(
                "System.Web.Services.Discovery.DiscoveryDocumentReference");

            // Set the URL for the reference.
            myDiscoveryClientResult.set_Url(
                "http://localhost/Discovery/Service1_jsl.asmx?disco");

            // Set the name of the file in which the reference is saved.
            myDiscoveryClientResult.set_Filename("Service1_jsl.disco");

            // Add myDiscoveryClientResult to the collection.
            myDiscoveryClientResultCollection.Add(myDiscoveryClientResult);
            if (myDiscoveryClientResultCollection.
                Contains(myDiscoveryClientResult)) {
                Console.WriteLine("Instance of DiscoveryClientResult found "
                    + "in the Collection");
            }
        }
        catch (System.Exception ex) {
            Console.WriteLine("Error is " + ex.get_Message());
        }
    } //main
} //MyDiscoveryClientResult

System.Object
   System.Collections.CollectionBase
    System.Web.Services.Discovery.DiscoveryClientResultCollection
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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.