ServiceDescription.Read Method (Stream)

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

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

public:
static ServiceDescription^ Read (
	Stream^ stream
)
public static ServiceDescription Read (
	Stream stream
)
public static function Read (
	stream : Stream
) : ServiceDescription
Not applicable.

Parameters

stream

A Stream, passed by reference, which contains the bytes to be read.

Return Value

A ServiceDescription.

// Create a StreamReader to read a WSDL file.
StreamReader^ myStreamReader = gcnew StreamReader( "MyWsdl.wsdl" );
ServiceDescription^ myDescription = ServiceDescription::Read( myStreamReader );
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 );
}

// Create a StreamReader to read a WSDL file.
StreamReader myStreamReader = new StreamReader("MyWsdl_JSL.wsdl");
ServiceDescription myDescription 
    = ServiceDescription.Read(myStreamReader);
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: