DiscoveryClientProtocol.Download Method (String, String)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Downloads the discovery document at the supplied URL into a Stream object, setting the contentType parameter to the MIME encoding of the discovery document.

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

[PermissionSetAttribute(SecurityAction.LinkDemand, Name = "FullTrust")]
public Stream Download(
	ref string url,
	ref string contentType
)

Parameters

url
Type: System.String

The URL of the discovery document to download.

contentType
Type: System.String

The MIME encoding of the downloaded discovery document.

Return Value

Type: System.IO.Stream

A Stream containing the document at the supplied URL.

Exception Condition
WebException

The download from the supplied URL returned an HTTP status code other than OK.

string myDiscoFile = "http://localhost/MathService_cs.vsdisco";
string myEncoding = "";
DiscoveryClientProtocol myDiscoveryClientProtocol = 
      new DiscoveryClientProtocol();

Stream myStream = myDiscoveryClientProtocol.Download
      (ref myDiscoFile,ref myEncoding);
Console.WriteLine("The length of the stream in bytes: "+
      myStream.Length);
Console.WriteLine("The MIME encoding of the downloaded "+
      "discovery document: "+ myEncoding);
myStream.Close();

.NET Framework
Available since 1.1
Return to top
Show: