2009-04-28 15 views
0

私は、WCFサービスに接続するときSystem.ServiceModel.EndpointAddressを作成するには、次の機能を使用しています:プログラムで設定アイデンティティ

private static EndpointAddress GetEndPointAddress(string url, EndpointIdentity identity) 
{ 
    Uri baseAddress = new Uri(url); 
    EndpointAddress endpointAddress = new EndpointAddress(
     baseAddress, 
     identity, 
     new AddressHeaderCollection()); 
    return endpointAddress; 
} 

私は私のウェブからの抜粋と相関EndPointIdentityに渡す必要があります。設定:

<identity> 
    <dns value="Some Value" /> 
</identity> 

私のWCFサービスは、X509証明書を使用していますので、私のアイデンティティがタイプX509CertificateEndpointIdentityであることが必要であると思われます。このためのコンストラクタでは、証明書を渡す必要がありますが、上記のように、DNS値を渡したいと思います。

私のアプローチで何が間違っているとお考えですか?実際に

答えて

5

次のように私は、DnsEndpointIdentityを作成するために必要な:

DnsEndpointIdentity identity = new DnsEndpointIdentity("Some value"); 
関連する問題