ContractReference クラスとは? わかりやすく解説

ContractReference クラス

探索ドキュメント内にあるサービス説明への参照表します

名前空間: System.Web.Services.Discovery
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Public Class ContractReference
    Inherits DiscoveryReference
Dim instance As ContractReference
public class ContractReference : DiscoveryReference
public ref class ContractReference : public
 DiscoveryReference
public class ContractReference extends DiscoveryReference
public class ContractReference extends
 DiscoveryReference
解説解説
使用例使用例
Imports System
Imports System.Xml
Imports System.IO
Imports System.Web.Services.Discovery

Public Class MyContractReference
   Shared Sub Main()
      Try
         ' Get a 'DiscoveryDocument' object.
         Dim myDiscoveryDocument As New
 DiscoveryDocument()
         ' Get a 'ContractReference' object.
         Dim myContractReference As New
 ContractReference()
         ' Set the URL to the referenced service description.
         myContractReference.Ref = "http://localhost/service1.asmx?wsdl"
         ' Set the URL for a XML Web service implementing the service
         ' description .
         myContractReference.DocRef = "http://localhost/service1.asmx"
         Dim myBinding As New
 SoapBinding()
         myBinding.Binding = New XmlQualifiedName("q1:Service1Soap")
         myBinding.Address = "http://localhost/service1.asmx"
         ' Add 'myContractReference' to the list of references contained
 
         ' within the discovery document.
         myDiscoveryDocument.References.Add(myContractReference)
         ' Add 'Binding' to referenceCollection.
         myDiscoveryDocument.References.Add(myBinding)
         ' Open or create a file for writing .
         Dim myFileStream As New
 FileStream("Service1.disco", FileMode.OpenOrCreate,
 FileAccess.Write)
         Dim myStreamWriter As New
 StreamWriter(myFileStream)
         ' Write 'myDiscoveryDocument' into the passed stream.
         myDiscoveryDocument.Write(myStreamWriter)
         Console.WriteLine("The 'Service1.disco' is generated.")
      Catch e As Exception
         Console.WriteLine("Error is" + e.Message)
      End Try
   End Sub 'Main
End Class 'MyContractReference
using System;
using System.Xml;
using System.IO;
using System.Web.Services.Discovery;

public class MyContractReference
{
   static void Main()
   {
      try
      {
         // Get a DiscoveryDocument.
         DiscoveryDocument myDiscoveryDocument = new  DiscoveryDocument();

         // Get a ContractReference.
         ContractReference myContractReference = new ContractReference();

         // Set the URL to the referenced service description.
         myContractReference.Ref = "http://localhost/service1.asmx?wsdl";

         // Set the URL for an XML Web service implementing the service
         // description.
         myContractReference.DocRef = "http://localhost/service1.asmx";
         SoapBinding myBinding = new SoapBinding();
         myBinding.Binding = new XmlQualifiedName("q1:Service1Soap");
         myBinding.Address = "http://localhost/service1.asmx";

         // Add myContractReference to the list of references contained
 
         // in the discovery document.
         myDiscoveryDocument.References.Add(myContractReference); 

         // Add Binding to the references collection.
         myDiscoveryDocument.References.Add(myBinding);

         // Open or create a file for writing.
         FileStream myFileStream = new FileStream("Service1.disco"
,
             FileMode.OpenOrCreate, FileAccess.Write );
         StreamWriter myStreamWriter = new StreamWriter( myFileStream
 );

         // Write myDiscoveryDocument into the passed stream.
         myDiscoveryDocument.Write( myStreamWriter );
         Console.WriteLine("The Service1.disco is generated.");
      }
      catch(Exception e)
      {
         Console.WriteLine("Error is "+ 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;
int main()
{
   try
   {
      
      // Get a DiscoveryDocument.
      DiscoveryDocument^ myDiscoveryDocument = gcnew DiscoveryDocument;
      
      // Get a ContractReference.
      ContractReference^ myContractReference = gcnew ContractReference;
      
      // Set the URL to the referenced service description.
      myContractReference->Ref = "http://localhost/service1.asmx?wsdl";
      
      // Set the URL for an XML Web service implementing the service
      // description.
      myContractReference->DocRef = "http://localhost/service1.asmx";
      SoapBinding^ myBinding = gcnew SoapBinding;
      myBinding->Binding = gcnew XmlQualifiedName( "q1:Service1Soap"
 );
      myBinding->Address = "http://localhost/service1.asmx";
      
      // Add myContractReference to the list of references contained
      // in the discovery document.
      myDiscoveryDocument->References->Add( myContractReference );
      
      // Add Binding to the references collection.
      myDiscoveryDocument->References->Add( myBinding );
      
      // Open or create a file for writing.
      FileStream^ myFileStream = gcnew FileStream( "Service1.disco",FileMode::OpenOrCreate,FileAccess::Write
 );
      StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream );
      
      // Write myDiscoveryDocument into the passed stream.
      myDiscoveryDocument->Write( myStreamWriter );
      Console::WriteLine( "The Service1.disco is generated." );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Error is {0}", e->Message );
   }

}

import System.*;
import System.Xml.*;
import System.IO.*;
import System.Web.Services.Discovery.*;

public class MyContractReference
{
    public static void main(String[]
 args)
    {
        try {
            // Get a DiscoveryDocument.
            DiscoveryDocument myDiscoveryDocument = new DiscoveryDocument();

            // Get a ContractReference.
            ContractReference myContractReference = new ContractReference();

            // Set the URL to the referenced service description.
            myContractReference.set_Ref("http://localhost/service1.asmx?wsdl");

            // Set the URL for an XML Web service implementing the service
            // description.
            myContractReference.set_DocRef("http://localhost/service1.asmx");

            SoapBinding myBinding = new SoapBinding();

            myBinding.set_Binding(new XmlQualifiedName("q1:Service1Soap"));
            myBinding.set_Address("http://localhost/service1.asmx");

            // Add myContractReference to the list of references contained
 
            // in the discovery document.
            myDiscoveryDocument.get_References().Add(myContractReference);

            // Add Binding to the references collection.
            myDiscoveryDocument.get_References().Add(myBinding);

            // Open or create a file for writing.
            FileStream myFileStream = new FileStream("Service1.disco"
, 
                FileMode.OpenOrCreate, FileAccess.Write);
            StreamWriter myStreamWriter = new StreamWriter(myFileStream);

            // Write myDiscoveryDocument into the passed stream.
            myDiscoveryDocument.Write(myStreamWriter);
            Console.WriteLine("The Service1.disco is generated.");
        }
        catch (System.Exception e) {
            Console.WriteLine("Error is " + e.get_Message());
        }
    } //main
} //MyContractReference
継承階層継承階層
System.Object
   System.Web.Services.Discovery.DiscoveryReference
    System.Web.Services.Discovery.ContractReference
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ContractReference メンバ
System.Web.Services.Discovery 名前空間
DiscoveryReference
ServiceDescription クラス
SchemaReference
DiscoveryDocumentReference
DiscoveryClientProtocol



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ContractReference クラス」の関連用語

ContractReference クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ContractReference クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS