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:
static ServiceDescription^ Read (
	String^ fileName
)
public static ServiceDescription Read (
	String fileName
)
public static function Read (
	fileName : String
) : ServiceDescription
Not applicable.

Parameters

fileName

The path to the file to be read.

Return Value

A ServiceDescription.

ServiceDescription^ myDescription = gcnew ServiceDescription;
myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" );
myDescription->Name = "MyServiceDescription";
Console::WriteLine( "Name: {0}", myDescription->Name );
MessageCollection^ myMessageCollection = myDescription->Messages;

// Remove the message at index 0 from the message collection.
myMessageCollection->Remove( myDescription->Messages[ 0 ] );

// Build a new message.
Message^ myMessage = gcnew Message;
myMessage->Name = "AddSoapIn";

// Build a new MessagePart.
MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = "parameters";
XmlQualifiedName^ myXmlQualifiedName = gcnew 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" );

ServiceDescription myDescription = new ServiceDescription();
myDescription = ServiceDescription.Read("MyWsdl_JSL.wsdl");
myDescription.set_Name("MyServiceDescription");
Console.WriteLine("Name: " + myDescription.get_Name());
MessageCollection myMessageCollection = myDescription.get_Messages();
// Remove the message at index 0 from the message collection.
myMessageCollection.Remove(myDescription.get_Messages().get_Item(0));
// Build a new message.
Message myMessage = new Message();
myMessage.set_Name("AddSoapIn");
// Build a new MessagePart.
MessagePart myMessagePart = new MessagePart();
myMessagePart.set_Name("parameters");
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:Add");
myMessagePart.set_Element(myXmlQualifiedName);
// Add MessageParts to the message.
myMessage.get_Parts().Add(myMessagePart);
// Add the message to the ServiceDescription.
myDescription.get_Messages().Add(myMessage);
myDescription.Write("MyOutWsdl.wsdl");

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: