ContractReference.WriteDocument(Object, Stream) メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
渡された Stream に渡されたサービスの説明を書き込みます。
public:
override void WriteDocument(System::Object ^ document, System::IO::Stream ^ stream);
public override void WriteDocument (object document, System.IO.Stream stream);
override this.WriteDocument : obj * System.IO.Stream -> unit
Public Overrides Sub WriteDocument (document As Object, stream As Stream)
パラメーター
- document
- Object
stream
に書き込む ServiceDescription。
- stream
- Stream
シリアル化した Stream の書き込み先の ServiceDescription。
例
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( "TestOutput_cs.wsdl",
FileMode.OpenOrCreate, FileAccess.Write );
// Get the ServiceDescription for the test .wsdl file.
ServiceDescription myServiceDescription =
ServiceDescription.Read("TestInput_cs.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: "
+ myFileStream.Length);
myFileStream.Close();
Dim myContractReference As New ContractReference()
Dim myFileStream As New FileStream("TestOutput_vb.wsdl", _
FileMode.OpenOrCreate, FileAccess.Write)
' Get the ServiceDescription for the test .wsdl file.
Dim myServiceDescription As ServiceDescription = _
ServiceDescription.Read("TestInput_vb.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: " + _
myFileStream.Length.ToString())
myFileStream.Close()
適用対象
こちらもご覧ください
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET