更新 : 2007 年 11 月
サービスの説明からエンドポイントのコレクションを取得します。
名前空間 :
System.ServiceModel.Description
アセンブリ :
System.ServiceModel (System.ServiceModel.dll 内)
Public ReadOnly Property Endpoints As ServiceEndpointCollection
Dim instance As ServiceDescription
Dim value As ServiceEndpointCollection
value = instance.Endpoints
public ServiceEndpointCollection Endpoints { get; }
public:
property ServiceEndpointCollection^ Endpoints {
ServiceEndpointCollection^ get ();
}
/** @property */
public ServiceEndpointCollection get_Endpoints()
public function get Endpoints () : ServiceEndpointCollection
このメソッドによって返される ServiceEndpointCollection に含まれるエンドポイントには、サービスとの通信に必要なアドレス、バインディング、コントラクト、および動作の情報がそれぞれ含まれます。この情報にアクセスするには、関連する検索基準を使用して Find メソッドを実行して、コレクションから ServiceEndpoint を取得する必要があります。その後、ServiceEndpoint プロパティを使用して情報にアクセスします。たとえば、Contract プロパティを使用して ContractDescription にアクセスできます。
ServiceEndpoint をパラメータとして ExportEndpoint(ServiceEndpoint) に渡すことにより、サービス エンドポイントについてのメタデータをエクスポートします。
// 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
参照