DiscoveryClientProtocol.Download Method (String, String)

 

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 Function Download (
	ByRef url As String,
	ByRef contentType As String
) As Stream

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.

Dim myDiscoFile As String = "http://localhost/MathService_vb.vsdisco"
Dim myEncoding As String = ""
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()

Dim myStream As Stream = myDiscoveryClientProtocol.Download(myDiscoFile, 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: