ServiceDescription.Read Method (String)

 

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

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

Public Shared Function Read (
	fileName As String
) As ServiceDescription

Parameters

fileName
Type: System.String

The path to the file to be read.

Dim myDescription As New ServiceDescription()
myDescription = ServiceDescription.Read("MyWsdl_VB.wsdl")
myDescription.Name = "MyServiceDescription"
Console.WriteLine("Name: " & myDescription.Name)
Dim myMessageCollection As MessageCollection = myDescription.Messages

' Remove the message at index 0 from the message collection.
myMessageCollection.Remove(myDescription.Messages(0))

' Build a new Message.
Dim myMessage As New Message()
myMessage.Name = "AddSoapIn"

' Build a new MessagePart.
Dim myMessagePart As New MessagePart()
myMessagePart.Name = "parameters"
Dim myXmlQualifiedName As New XmlQualifiedName("s0:Add")
myMessagePart.Element = myXmlQualifiedName

' Add MessageParts to the message.
myMessage.Parts.Add(myMessagePart)

' Add the message to the ServiceDescription.
myDescription.Messages.Add(myMessage)
myDescription.Write("MyOutWsdl.wsdl")

.NET Framework
Available since 1.1
Return to top
Show: