ContractReference.ReadDocument Method (Stream)

 

Reads the service description from the passed Stream and returns the service description.

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

Public Overrides Function ReadDocument (
	stream As Stream
) As Object

Parameters

stream
Type: System.IO.Stream

Stream containing the service description.

Return Value

Type: System.Object

A ServiceDescription containing the contents of the referenced service description.

Class MyClass1

   Shared Sub Main()
      Try
         ' Create the file stream.
         Dim wsdlStream As _
             New FileStream("MyService1_vb.wsdl", FileMode.Open)
         Dim myContractReference As New ContractReference()

         ' Read the service description from the passed stream.
         Dim myServiceDescription As ServiceDescription = _
             CType(myContractReference.ReadDocument(wsdlStream), _
             ServiceDescription)
         Console.Write(("Target Namesapce for the service description is: " _
             + myServiceDescription.TargetNamespace))
         wsdlStream.Close()

      Catch e As Exception
         Console.WriteLine(("Exception: " + e.Message))
      End Try
   End Sub 'Main
End Class 'MyClass1

.NET Framework
Available since 1.1
Return to top
Show: