This documentation is archived and is not being maintained.

ServiceDescription.Read Method

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

Overload List

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

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

Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

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

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

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

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

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

Example

[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] 
' Create a new XmlTextWriter with specified URL.
Dim myXmlReader As New XmlTextReader("All_VB.wsdl")
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read(myXmlReader)
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Remove the service named MathService.
Dim myServiceDescriptionCollection As ServiceCollection = _
   myServiceDescription.Services
myServiceDescriptionCollection.Remove( _
   myServiceDescription.Services("MathService"))

[C#] 
// Create a new XmlTextWriter with specified URL.
XmlTextReader myXmlReader = new XmlTextReader("All_CS.wsdl");
ServiceDescription myServiceDescription = 
   ServiceDescription.Read(myXmlReader);
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection myServiceDescriptionCollection =
   myServiceDescription.Services;
myServiceDescriptionCollection.Remove(
   myServiceDescription.Services["MathService"]);

[C++] 
// Create a new XmlTextWriter with specified URL.
XmlTextReader* myXmlReader = new XmlTextReader(S"All_CS.wsdl");
ServiceDescription* myServiceDescription = 
   ServiceDescription::Read(myXmlReader);
myServiceDescription->TargetNamespace = S"http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection* myServiceDescriptionCollection =
   myServiceDescription->Services;
myServiceDescriptionCollection->Remove(
   myServiceDescription->Services->Item[S"MathService"]);

[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

ServiceDescription Class | ServiceDescription Members | System.Web.Services.Description Namespace

Show: