This documentation is archived and is not being maintained.

ContractReference::WriteDocument Method

Writes the passed-in service description into the passed-in Stream.

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

public:
virtual void WriteDocument(
	Object^ document, 
	Stream^ stream
) override

Parameters

document
Type: System::Object

The ServiceDescription to write into stream.

stream
Type: System.IO::Stream

The Stream into which the serialized ServiceDescription is written.

ContractReference^ myContractReference = gcnew ContractReference;
FileStream^ myFileStream = gcnew FileStream( "TestOutput_cpp.wsdl",
   FileMode::OpenOrCreate,FileAccess::Write );

// Get the ServiceDescription for the test .wsdl file.
ServiceDescription^ myServiceDescription =
   ServiceDescription::Read( "TestInput_cpp.wsdl" );

// Write the ServiceDescription into the file stream.
myContractReference->WriteDocument( myServiceDescription, myFileStream );
Console::WriteLine( "ServiceDescription is written "
   + "into the file stream successfully." );
Console::WriteLine( "The number of bytes written into the file stream: {0}",
   myFileStream->Length );
myFileStream->Close();
ContractReference* myContractReference = new ContractReference();
FileStream* myFileStream = new FileStream(S"TestOutput_cs.wsdl",
   FileMode::OpenOrCreate, FileAccess::Write);

// Get the ServiceDescription for the test .wsdl file.
ServiceDescription* myServiceDescription  =
   ServiceDescription::Read(S"TestInput_cs.wsdl");

// Write the ServiceDescription into the file stream.
myContractReference->WriteDocument(myServiceDescription, myFileStream);
Console::WriteLine(S"ServiceDescription is written into the file stream successfully.");
Console::WriteLine(S"The number of bytes written into the file stream: {0}", 
   __box(myFileStream->Length));
myFileStream->Close();

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: