ServiceDescription::Read Method (TextReader^)

 

Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

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

public:
static ServiceDescription^ Read(
	TextReader^ textReader
)

Parameters

textReader
Type: System.IO::TextReader^

A TextReader instance, passed by reference, which contains the text to be read.

ServiceDescription^ myDescription = gcnew ServiceDescription;

// Create a StreamReader to read a WSDL file.
TextReader^ myTextReader = gcnew StreamReader( "MyWsdl.wsdl" );
myDescription = ServiceDescription::Read( myTextReader );
Console::WriteLine( "Bindings are: " );

// Display the Bindings present in the WSDL file.
System::Collections::IEnumerator^ myEnum = myDescription->Bindings->GetEnumerator();
while ( myEnum->MoveNext() )
{
   Binding^ myBinding = safe_cast<Binding^>(myEnum->Current);
   Console::WriteLine( myBinding->Name );
}

.NET Framework
Available since 1.1
Return to top
Show: