ContractReference::WriteDocument Method (Object^, Stream^)

 

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();

.NET Framework
Available since 1.1
Return to top
Show: