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
)
public static ServiceDescription Read (
	TextReader textReader
)
public static function Read (
	textReader : TextReader
) : ServiceDescription
Not applicable.

Parameters

textReader

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

Return Value

A ServiceDescription.

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 );
}

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

// Display the Bindings present in the WSDL file.
for (int iCtr = 0; iCtr < myDescription.get_Bindings().
    get_Count(); iCtr++) {
    Binding myBinding = myDescription.get_Bindings().get_Item(iCtr);
    Console.WriteLine(myBinding.get_Name());
}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: