This documentation is archived and is not being maintained.
ServiceDescription::Read Method (String)
Visual Studio 2008
Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.
Assembly: System.Web.Services (in System.Web.Services.dll)
Parameters
- fileName
- Type: System::String
The path to the file to be read.
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(S"MyWsdl_CS.wsdl");
myDescription->Name = S"MyServiceDescription";
Console::WriteLine(S"Name: {0}", myDescription->Name);
MessageCollection* myMessageCollection = myDescription->Messages;
// Remove the message at index 0 from the message collection.
myMessageCollection->Remove(myDescription->Messages->Item[0]);
// Build a new message.
Message* myMessage = new Message();
myMessage->Name = S"AddSoapIn";
// Build a new MessagePart.
MessagePart* myMessagePart = new MessagePart();
myMessagePart->Name = S"parameters";
XmlQualifiedName* myXmlQualifiedName = new XmlQualifiedName(S"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(S"MyOutWsdl.wsdl");
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: