DiscoveryDocument DiscoveryDocument DiscoveryDocument DiscoveryDocument Class

定義

探索ドキュメントを表します。Represents a discovery document. このクラスは継承できません。This class cannot be inherited.

public ref class DiscoveryDocument sealed
public sealed class DiscoveryDocument
type DiscoveryDocument = class
Public NotInheritable Class DiscoveryDocument
継承
DiscoveryDocumentDiscoveryDocumentDiscoveryDocumentDiscoveryDocument

次のコード例では、 Readを使用してファイルから探索ドキュメントを読み取り、 Writeメソッドを使用してファイルに書き戻します。The following code example reads a discovery document from a file using the Read and writes it back out to file using the Write method.

#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 );
   }

}

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

注釈

XML Web サービスの検出では、URL が指定されている場合に、使用可能な XML Web サービスを検出します。XML Web services discovery involves discovering the available XML Web services, given an URL. 通常、URL は探索ドキュメントを指します。このドキュメントには、通常、.disco ファイル名拡張子が付いています。The URL typically points to a discovery document, which usually has a .disco file name extension. XML ドキュメントである探索ドキュメントには、サービスの説明、XML スキーマ定義 (XSD) 言語スキーマ、またはその他の探索ドキュメントなど、XML Web サービスの存在に関する情報への参照が含まれています。The discovery document, which is an XML document, contains references to information about the existence of XML Web services, such as a service description, XML Schema Definition (XSD) language schema, or another discovery document. このクラスは、探索ドキュメントの内容を表します。このプロパティReferencesには、探索ドキュメント内に含まれる参照の一覧が含まれます。This class represents the contents of the discovery document; where the References property contains a list of the references contained within the discovery document.

コンストラクター

DiscoveryDocument() DiscoveryDocument() DiscoveryDocument() DiscoveryDocument()

DiscoveryDocument クラスの新しいインスタンスを初期化します。Initializes a new instance of the DiscoveryDocument class.

フィールド

Namespace Namespace Namespace Namespace

探索ドキュメントの探索 XML 要素の名前空間。Namespace of the discovery XML element of a discovery document.

プロパティ

References References References References

探索ドキュメントに含まれている参照のリスト。A list of references contained within the discovery document.

メソッド

CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader)

渡された XmlReaderDiscoveryDocument に逆シリアル化できるかどうかを示す値を返します。Returns a value indicating whether the passed XmlReader can be deserialized into a DiscoveryDocument.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

既定のハッシュ関数として機能します。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

現在のインスタンスの Type を取得します。Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object.

(Inherited from Object)
Read(Stream) Read(Stream) Read(Stream) Read(Stream)

渡された DiscoveryDocument から Stream を読み取って返します。Reads and returns a DiscoveryDocument from the passed Stream.

Read(TextReader) Read(TextReader) Read(TextReader) Read(TextReader)

渡された DiscoveryDocument から TextReader を読み取って返します。Reads and returns a DiscoveryDocument from the passed TextReader.

Read(XmlReader) Read(XmlReader) Read(XmlReader) Read(XmlReader)

渡された DiscoveryDocument から XmlReader を読み取って返します。Reads and returns a DiscoveryDocument from the passed XmlReader.

ToString() ToString() ToString() ToString()

現在のオブジェクトを表す文字列を返します。Returns a string that represents the current object.

(Inherited from Object)
Write(Stream) Write(Stream) Write(Stream) Write(Stream)

渡された DiscoveryDocumentStream を書き込みます。Writes this DiscoveryDocument into the passed Stream.

Write(TextWriter) Write(TextWriter) Write(TextWriter) Write(TextWriter)

渡された DiscoveryDocumentTextWriter を書き込みます。Writes this DiscoveryDocument into the passed TextWriter.

Write(XmlWriter) Write(XmlWriter) Write(XmlWriter) Write(XmlWriter)

渡された DiscoveryDocumentXmlWriter を書き込みます。Writes this DiscoveryDocument into the passed XmlWriter.

適用対象

こちらもご覧ください