ServiceDescriptionImporterとは? わかりやすく解説

ServiceDescriptionImporter クラス

XML Web サービスのためのクライアント プロキシ クラス生成方法公開します

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

Public Class ServiceDescriptionImporter
Dim instance As ServiceDescriptionImporter
public class ServiceDescriptionImporter
public ref class ServiceDescriptionImporter
public class ServiceDescriptionImporter
public class ServiceDescriptionImporter
解説解説
使用例使用例

ServiceDescriptionImporter クラス使用して WSDL ファイル記述されている XML Web サービス呼び出すプロキシ クライアント コード生成する例を次に示します

using System;
using System.Web.Services.Description;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Security.Permissions;

public class Import {

    public static void Main()
 
    {
        Run();
    }

    [PermissionSetAttribute(SecurityAction.Demand, Name = "Full Trust")]
    public static void Run()
    {
    // Get a WSDL file describing a service.
    ServiceDescription description = ServiceDescription.Read("service.wsdl");

    // Initialize a service description importer.
    ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
    importer.ProtocolName = "Soap12";  // Use SOAP 1.2.
    importer.AddServiceDescription(description,null,null);

    // Report on the service descriptions.
    Console.WriteLine("Importing {0} service descriptions with {1} associated
 schemas.",
                      importer.ServiceDescriptions.Count, importer.Schemas.Count);

    // Generate a proxy client.
    importer.Style = ServiceDescriptionImportStyle.Client;

    // Generate properties to represent primitive values.
    importer.CodeGenerationOptions = System.Xml.Serialization.CodeGenerationOptions.GenerateProperties;

    // Initialize a Code-DOM tree into which we will import the service.
    CodeNamespace nmspace = new CodeNamespace();
    CodeCompileUnit unit = new CodeCompileUnit();
    unit.Namespaces.Add(nmspace);

    // Import the service into the Code-DOM tree. This creates proxy
 code
    // that uses the service.
    ServiceDescriptionImportWarnings warning = importer.Import(nmspace,unit);

    if (warning == 0)
    {
        // Generate and print the proxy code in C#.
        CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp");
        provider.GenerateCodeFromCompileUnit(unit, Console.Out, new
 CodeGeneratorOptions() );
    }
    else
    {
        // Print an error message.
        Console.WriteLine(warning); 
    }
}


}
#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>

using namespace System;
using namespace System::Web::Services::Description;
using namespace System::CodeDom;
using namespace System::CodeDom::Compiler;

int main()
{
   // Get a WSDL file describing a service.
   ServiceDescription^ description = ServiceDescription::Read( "service.wsdl"
 );

   // Initialize a service description importer.
   ServiceDescriptionImporter^ importer = gcnew ServiceDescriptionImporter;
   importer->ProtocolName = "Soap12"; // Use SOAP 1.2.
   importer->AddServiceDescription( description, nullptr, nullptr );

   // Report on the service descriptions.
   Console::WriteLine( "Importing {0} service descriptions with {1} associated
 schemas.", importer->ServiceDescriptions->Count, importer->Schemas->Count
 );

   // Generate a proxy client.
   importer->Style = ServiceDescriptionImportStyle::Client;

   // Generate properties to represent primitive values.
   importer->CodeGenerationOptions = System::Xml::Serialization::CodeGenerationOptions::GenerateProperties;

   // Initialize a Code-DOM tree into which we will import the service.
   CodeNamespace^ nmspace = gcnew CodeNamespace;
   CodeCompileUnit^ unit = gcnew CodeCompileUnit;
   unit->Namespaces->Add( nmspace );
   
   // Import the service into the Code-DOM tree. This creates proxy
 code
   // that uses the service.
   ServiceDescriptionImportWarnings warning = importer->Import(nmspace,unit);
   if ( warning == (ServiceDescriptionImportWarnings)0 )
   {
      // Generate and print the proxy code in C#.
      CodeDomProvider^ provider = CodeDomProvider::CreateProvider( "CSharp"
 );
      ICodeGenerator^ generator = provider->CreateGenerator();
      generator->GenerateCodeFromCompileUnit( unit, Console::Out, gcnew CodeGeneratorOptions
 );
   }
   else
   {
      // Print an error message.
      Console::WriteLine( warning );
   }
}
継承階層継承階層
System.Object
  System.Web.Services.Description.ServiceDescriptionImporter
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ServiceDescriptionImporter メンバ
System.Web.Services.Description 名前空間

ServiceDescriptionImporter コンストラクタ

ServiceDescriptionImporter クラス新しインスタンス初期化します。

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

Dim instance As New ServiceDescriptionImporter
public ServiceDescriptionImporter ()
public:
ServiceDescriptionImporter ()
public ServiceDescriptionImporter ()
public function ServiceDescriptionImporter
 ()
使用例使用例

このコンストラクタ使用例次に示します

// Initialize a service description importer.
ServiceDescriptionImporter importer = new ServiceDescriptionImporter();
importer.ProtocolName = "Soap12";  // Use SOAP 1.2.
importer.AddServiceDescription(description,null,null);
// Initialize a service description importer.
ServiceDescriptionImporter^ importer = gcnew ServiceDescriptionImporter;
importer->ProtocolName = "Soap12"; // Use SOAP 1.2.
importer->AddServiceDescription( description, nullptr, nullptr );
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ServiceDescriptionImporter クラス
ServiceDescriptionImporter メンバ
System.Web.Services.Description 名前空間

ServiceDescriptionImporter プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ CodeGenerationOptions コード生成さまざまなオプション取得または設定します
パブリック プロパティ CodeGenerator サービス説明インポータによって使用されるコード ジェネレータ取得または設定します
パブリック プロパティ ProtocolName 記述されている XML Web サービスアクセスするために使用されるプロトコル取得または設定します
パブリック プロパティ Schemas ServiceDescriptions プロパティによって使用される XmlSchemas を取得します
パブリック プロパティ ServiceDescriptions インポートされる ServiceDescription インスタンスコレクション取得します
パブリック プロパティ Style ServiceDescriptions 値がインポートされるときに生成されるコードスタイル (クライアントまたはサーバー) を決定する値を取得または設定します
参照参照

関連項目

ServiceDescriptionImporter クラス
System.Web.Services.Description 名前空間

ServiceDescriptionImporter メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ServiceDescriptionImporter クラス
System.Web.Services.Description 名前空間

ServiceDescriptionImporter メンバ

XML Web サービスのためのクライアント プロキシ クラス生成方法公開します

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ServiceDescriptionImporter ServiceDescriptionImporter クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ CodeGenerationOptions コード生成さまざまなオプション取得または設定します
パブリック プロパティ CodeGenerator サービス説明インポータによって使用されるコード ジェネレータ取得または設定します
パブリック プロパティ ProtocolName 記述されている XML Web サービスアクセスするために使用されるプロトコル取得または設定します
パブリック プロパティ Schemas ServiceDescriptions プロパティによって使用される XmlSchemas を取得します
パブリック プロパティ ServiceDescriptions インポートされる ServiceDescription インスタンスコレクション取得します
パブリック プロパティ Style ServiceDescriptions 値がインポートされるときに生成されるコードスタイル (クライアントまたはサーバー) を決定する値を取得または設定します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ServiceDescriptionImporter クラス
System.Web.Services.Description 名前空間



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

辞書ショートカット

すべての辞書の索引

「ServiceDescriptionImporter」の関連用語

ServiceDescriptionImporterのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS