Export (0) Print
Expand All

DiscoveryClientProtocol.ResolveAll Method

Resolves all references to discovery documents, XML Schema Definition (XSD) schemas, and service descriptions in the References property, as well as references found in referenced discovery documents.

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

[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public void ResolveAll()

ResolveAll resolves all valid references it finds and places them in the Documents property. Both ResolveAll and ResolveOneLevel download and verify XSD schemas and service descriptions in the References property. However, the two methods differ in how they handle discovery documents. ResolveOneLevel resolves all references in discovery documents within the References property; if a discovery document contains references to other discovery documents, ResolveOneLevel resolves just those discovery documents. Discovery documents found in those discovery documents nested one level deep are not resolved by ResolveOneLevel; whereas ResolveAll resolves them all. ResolveAll continues to resolve references in nested discovery documents until there are no more references.

Errors occurring during the verification process done by ResolveAll are not thrown at the time of occurrence, but rather collected and added to the Errors property.

The following code example is a Web Form that populates a DataGrid with the details about the documents in the Documents property together with the references found in each document during an XML Web services discovery. The PopulateGrid method fills the DataGrid with the results from a DiscoverAny invocation followed by a call to ResolveAll.

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

        DiscoveryClientProtocol client = new DiscoveryClientProtocol();
	// Use default credentials to access the URL being discovered.
        client.Credentials = CredentialCache.DefaultCredentials;

        try 
        {
       	  DiscoveryDocument doc;

          // Discover the URL for any discoverable documents. 
	  doc = client.DiscoverAny(sourceUrl);
	 
          // Resolve all possible references from the supplied URL.
          client.ResolveAll();
        }
        catch ( Exception e2) 
        {
          DiscoveryResultsGrid.Columns.Clear();
          Status.Text = e2.Message;
        }
	// If documents were discovered, display the results in a data grid.
        if (client.Documents.Count > 0)
	    PopulateGrid(client);

	// Save the discovery results to disk.
        DiscoveryClientResultCollection results = client.WriteAll(outputDirectory, "results.discomap");
        Status.Text = "The following file holds the links to each of the discovery results: <b>" + 
	                                Path.Combine(outputDirectory,"results.discomap") + "</b>";
  }

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft