This documentation is archived and is not being maintained.

DiscoveryDocumentReference.ReadDocument Method

Reads and returns the discovery document from the passed Stream.

[Visual Basic]
Overrides Public Function ReadDocument( _
   ByVal stream As Stream _
) As Object
[C#]
public override object ReadDocument(
 Stream stream
);
[C++]
public: Object* ReadDocument(
 Stream* stream
);
[JScript]
public override function ReadDocument(
   stream : Stream
) : Object;

Parameters

stream
Stream containing the discovery document.

Return Value

A DiscoveryDocument containing the contents of the referenced discovery document.

Example

[Visual Basic] 
Dim myUrl As String = "http://localhost/Sample_vb.vsdisco"
Dim myProtocol As New DiscoveryClientProtocol()
Dim myReference As New DiscoveryDocumentReference(myUrl)
Dim myFileStream As Stream = myProtocol.Download(myUrl)
Dim myDiscoveryDocument As DiscoveryDocument = _
        CType(myReference.ReadDocument(myFileStream), DiscoveryDocument)

[C#] 
string myUrl = "http://localhost/Sample_cs.vsdisco";
DiscoveryClientProtocol myProtocol = new DiscoveryClientProtocol();
DiscoveryDocumentReference myReference = new DiscoveryDocumentReference(myUrl);
Stream myFileStream = myProtocol.Download(ref myUrl);
DiscoveryDocument myDiscoveryDocument = 
                  (DiscoveryDocument)myReference.ReadDocument(myFileStream);

[C++] 
String* myUrl = S"http://localhost/Sample_cs.vsdisco";
DiscoveryClientProtocol* myProtocol = new DiscoveryClientProtocol();
DiscoveryDocumentReference* myReference = new DiscoveryDocumentReference(myUrl);
Stream*  myFileStream = myProtocol->Download((&myUrl));

DiscoveryDocument* myDiscoveryDocument =
   dynamic_cast<DiscoveryDocument*>(myReference->ReadDocument(myFileStream));

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DiscoveryDocumentReference Class | DiscoveryDocumentReference Members | System.Web.Services.Discovery Namespace | DiscoveryDocument | Stream | DiscoveryClientProtocol | ReadAll

Show: