.NET Framework クラス ライブラリ
ServiceDescription..::.Endpoints プロパティ

更新 : 2007 年 11 月

サービスの説明からエンドポイントのコレクションを取得します。

名前空間 :  System.ServiceModel.Description
アセンブリ :  System.ServiceModel (System.ServiceModel.dll 内)
構文

Visual Basic (宣言)
Public ReadOnly Property Endpoints As ServiceEndpointCollection
Visual Basic (使用法)
Dim instance As ServiceDescription
Dim value As ServiceEndpointCollection

value = instance.Endpoints
C#
public ServiceEndpointCollection Endpoints { get; }
Visual C++
public:
property ServiceEndpointCollection^ Endpoints {
    ServiceEndpointCollection^ get ();
}
J#
/** @property */
public ServiceEndpointCollection get_Endpoints()
JScript
public function get Endpoints () : ServiceEndpointCollection

プロパティ値

型 : System.ServiceModel.Description..::.ServiceEndpointCollection
サービスに定義されたエンドポイントを含む ServiceEndpointCollection
解説

このメソッドによって返される ServiceEndpointCollection に含まれるエンドポイントには、サービスとの通信に必要なアドレス、バインディング、コントラクト、および動作の情報がそれぞれ含まれます。この情報にアクセスするには、関連する検索基準を使用して Find メソッドを実行して、コレクションから ServiceEndpoint を取得する必要があります。その後、ServiceEndpoint プロパティを使用して情報にアクセスします。たとえば、Contract プロパティを使用して ContractDescription にアクセスできます。

ServiceEndpoint をパラメータとして ExportEndpoint(ServiceEndpoint) に渡すことにより、サービス エンドポイントについてのメタデータをエクスポートします。


C#
// Iterate through the endpoints contained in the ServiceDescription
ServiceEndpointCollection sec = svcDesc.Endpoints;
foreach (ServiceEndpoint se in sec)
{
    Console.WriteLine("Endpoint:");
    Console.WriteLine("\tAddress: {0}", se.Address.ToString());
    Console.WriteLine("\tBinding: {0}", se.Binding.ToString());
    Console.WriteLine("\tContract: {0}", se.Contract.ToString());
    KeyedByTypeCollection<IEndpointBehavior> behaviors = se.Behaviors;
    foreach (IEndpointBehavior behavior in behaviors)
    {
        Console.WriteLine("Behavior: {0}", behavior.ToString());
    }
}
アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。
プラットフォーム

Windows Vista, Windows XP SP2, Windows Server 2003

.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報

.NET Framework

サポート対象 : 3.5、3.0
参照

参照

タグ :


Page view tracker