This documentation is archived and is not being maintained.

DiscoveryDocument.Read Method

Reads and returns a DiscoveryDocument from the passed object.

Overload List

Reads and returns a DiscoveryDocument from the passed Stream.

[Visual Basic] Overloads Public Shared Function Read(Stream) As DiscoveryDocument
[C#] public static DiscoveryDocument Read(Stream);
[C++] public: static DiscoveryDocument* Read(Stream*);
[JScript] public static function Read(Stream) : DiscoveryDocument;

Reads and returns a DiscoveryDocument from the passed TextReader.

[Visual Basic] Overloads Public Shared Function Read(TextReader) As DiscoveryDocument
[C#] public static DiscoveryDocument Read(TextReader);
[C++] public: static DiscoveryDocument* Read(TextReader*);
[JScript] public static function Read(TextReader) : DiscoveryDocument;

Reads and returns a DiscoveryDocument from the passed XmlReader.

[Visual Basic] Overloads Public Shared Function Read(XmlReader) As DiscoveryDocument
[C#] public static DiscoveryDocument Read(XmlReader);
[C++] public: static DiscoveryDocument* Read(XmlReader*);
[JScript] public static function Read(XmlReader) : DiscoveryDocument;

Example

[Visual Basic, C#, C++] The following code example reads in the contents of a discovery document, if the CanRead property is true.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of Read. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
' Check whether the given XmlTextReader is readable.
If DiscoveryDocument.CanRead(myXmlTextReader) = True Then
   ' Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader)
Else
   Console.WriteLine("The supplied file is not readable")
End If

[C#] 
// Check whether the given XmlTextReader is readable.
if( DiscoveryDocument.CanRead( myXmlTextReader ) == true )
{
   // Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument.Read( myXmlTextReader );
}
else
{
   Console.WriteLine( "The supplied file is not readable" );
}

[C++] 
// Check whether the given XmlTextReader is readable.
if (DiscoveryDocument::CanRead(myXmlTextReader) == true)
   // Read the given XmlTextReader.
   myDiscoveryDocument = DiscoveryDocument::Read(myXmlTextReader);
else
   Console::WriteLine(S"The supplied file is not readable");

[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.

See Also

DiscoveryDocument Class | DiscoveryDocument Members | System.Web.Services.Discovery Namespace

Show: