DiscoveryDocument クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)


XML Web サービス探索には、指定 URL で使用できる XML Web サービスの探索が含まれます。通常、URL は探索ドキュメントを指します。探索ドキュメントのファイル名拡張子は通常 .disco です。XML ドキュメントである探索ドキュメントには、サービスの説明、XML スキーマ定義 (XSD) 言語スキーマ、他の探索ドキュメントなどの XML Web サービスがあるかどうかに関する情報への参照が含まれています。このクラスは、探索ドキュメントの内容を表します。References プロパティには探索ドキュメント内に含まれる参照のリストが格納されています。

Read を使用してファイルから探索ドキュメントを読み込み、このドキュメントを Write メソッドを使用してファイルに書き込むコード例を次に示します。
Imports System Imports System.Xml Imports System.IO Imports System.Web.Services.Discovery Imports System.Collections Public Class DiscoveryDocument_Example Shared Sub Main() Try ' Create an object of the 'DiscoveryDocument'. Dim myDiscoveryDocument As New DiscoveryDocument() ' Create an XmlTextReader with the sample file. Dim myXmlTextReader As New XmlTextReader("http://localhost/example_vb.disco") ' Read the given XmlTextReader. myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader) ' Write the DiscoveryDocument into the 'TextWriter'. Dim myFileStream As New FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.Write) Dim myStreamWriter As New StreamWriter(myFileStream) myDiscoveryDocument.Write(myStreamWriter) myStreamWriter.Flush() myStreamWriter.Close() ' Display the contents of the DiscoveryDocument onto the console. Dim myFileStream1 As New FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.Read) Dim myStreamReader As New StreamReader(myFileStream1) ' Set the file pointer to the begin. myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin) Console.WriteLine("The contents of the DiscoveryDocument are-") While myStreamReader.Peek() > - 1 Console.WriteLine(myStreamReader.ReadLine()) End While myStreamReader.Close() Catch e As Exception Console.WriteLine("Exception raised : {0}", e.Message.ToString()) End Try End Sub 'Main End Class 'DiscoveryDocument_Example
using System; using System.Xml; using System.IO; using System.Web.Services.Discovery; using System.Collections; public class DiscoveryDocument_Example { static void Main() { try { // Create an object of the 'DiscoveryDocument'. DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument(); // Create an XmlTextReader with the sample file. XmlTextReader myXmlTextReader = new XmlTextReader( "http://localhost/example_cs.disco" ); // Read the given XmlTextReader. myDiscoveryDocument = DiscoveryDocument.Read( myXmlTextReader ); // Write the DiscoveryDocument into the 'TextWriter'. FileStream myFileStream = new FileStream( "log.txt", FileMode.OpenOrCreate, FileAccess.Write ); StreamWriter myStreamWriter = new StreamWriter( myFileStream ); myDiscoveryDocument.Write( myStreamWriter ); myStreamWriter.Flush(); myStreamWriter.Close(); // Display the contents of the DiscoveryDocument onto the console. FileStream myFileStream1 = new FileStream( "log.txt", FileMode.OpenOrCreate, FileAccess.Read ); StreamReader myStreamReader = new StreamReader( myFileStream1 ); // Set the file pointer to the begin. myStreamReader.BaseStream.Seek(0, SeekOrigin.Begin); Console.WriteLine( "The contents of the DiscoveryDocument are-" ); while ( myStreamReader.Peek() > -1 ) { Console.WriteLine( myStreamReader.ReadLine() ); } myStreamReader.Close(); } catch( Exception e ) { Console.WriteLine( "Exception raised : {0}", e.Message); } } }
#using <System.Xml.dll> #using <System.Web.Services.dll> using namespace System; using namespace System::Xml; using namespace System::IO; using namespace System::Web::Services::Discovery; using namespace System::Collections; int main() { try { // Create an Object* of the 'DiscoveryDocument'. DiscoveryDocument^ myDiscoveryDocument = gcnew DiscoveryDocument; // Create an XmlTextReader with the sample file. XmlTextReader^ myXmlTextReader = gcnew XmlTextReader( "http://localhost/example_cs.disco" ); // Read the given XmlTextReader. myDiscoveryDocument = DiscoveryDocument::Read( myXmlTextReader ); // Write the DiscoveryDocument into the 'TextWriter'. FileStream^ myFileStream = gcnew FileStream( "log.txt",FileMode::OpenOrCreate,FileAccess::Write ); StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream ); myDiscoveryDocument->Write( myStreamWriter ); myStreamWriter->Flush(); myStreamWriter->Close(); // Display the contents of the DiscoveryDocument onto the console. FileStream^ myFileStream1 = gcnew FileStream( "log.txt",FileMode::OpenOrCreate,FileAccess::Read ); StreamReader^ myStreamReader = gcnew StreamReader( myFileStream1 ); // Set the file pointer to the begin. myStreamReader->BaseStream->Seek( 0, SeekOrigin::Begin ); Console::WriteLine( "The contents of the DiscoveryDocument are-" ); while ( myStreamReader->Peek() > -1 ) { Console::WriteLine( myStreamReader->ReadLine() ); } myStreamReader->Close(); } catch ( Exception^ e ) { Console::WriteLine( "Exception raised : {0}", e->Message ); } }
import System.*; import System.Xml.*; import System.IO.*; import System.Web.Services.Discovery.*; import System.Collections.*; public class DiscoveryDocumentExample { public static void main(String[] args) { try { // Create an object of the 'DiscoveryDocument'. DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument(); // Create an XmlTextReader with the sample file. XmlTextReader myXmlTextReader = new XmlTextReader("http://localhost/example_jsl.disco"); // Read the given XmlTextReader. myDiscoveryDocument = DiscoveryDocument.Read(myXmlTextReader); // Write the DiscoveryDocument into the 'TextWriter'. FileStream myFileStream = new FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter myStreamWriter = new StreamWriter(myFileStream); myDiscoveryDocument.Write(myStreamWriter); myStreamWriter.Flush(); myStreamWriter.Close(); // Display the contents of the DiscoveryDocument onto the console. FileStream myFileStream1 = new FileStream("log.txt" , FileMode.OpenOrCreate, FileAccess.Read); StreamReader myStreamReader = new StreamReader(myFileStream1); // Set the file pointer to the begin. myStreamReader.get_BaseStream().Seek(0, SeekOrigin.Begin); Console.WriteLine("The contents of the DiscoveryDocument are-"); while (myStreamReader.Peek() > -1) { Console.WriteLine(myStreamReader.ReadLine()); } myStreamReader.Close(); } catch (System.Exception e) { Console.WriteLine("Exception raised : {0}", e.get_Message()); } } //main } //DiscoveryDocumentExample

System.Web.Services.Discovery.DiscoveryDocument


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DiscoveryDocument コンストラクタ
アセンブリ: System.Web.Services (system.web.services.dll 内)


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DiscoveryDocument フィールド
DiscoveryDocument プロパティ
DiscoveryDocument メソッド

名前 | 説明 | |
---|---|---|
![]() | CanRead | 渡された XmlReader を DiscoveryDocument に逆シリアル化できるかどうかを示す値を返します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | Read | オーバーロードされます。 渡されたオブジェクトから DiscoveryDocument を読み取って返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
![]() | Write | オーバーロードされます。 DiscoveryDocument を渡されたオブジェクトに書き込みます。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

DiscoveryDocument メンバ
DiscoveryDocument データ型で公開されるメンバを以下の表に示します。




名前 | 説明 | |
---|---|---|
![]() | CanRead | 渡された XmlReader を DiscoveryDocument に逆シリアル化できるかどうかを示す値を返します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | Read | オーバーロードされます。 渡されたオブジェクトから DiscoveryDocument を読み取って返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
![]() | Write | オーバーロードされます。 DiscoveryDocument を渡されたオブジェクトに書き込みます。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- DiscoveryDocumentのページへのリンク