2012-04-10 8 views
0

私はクライアント証明書を要求したいRESTサービスを持っています。次のようにsystem.serviceModelに見える:クライアント証明書をstandardEndpointに追加していますか?

<system.serviceModel> 
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> 
    <standardEndpoints> 
     <webHttpEndpoint> 
     <!-- 
      Configure the WCF REST service base address via the global.asax.cs file and the default endpoint 
      via the attributes on the <standardEndpoint> element below 
     --> 
     <standardEndpoint name="TestService" helpEnabled="true" automaticFormatSelectionEnabled="true"/> 
     </webHttpEndpoint> 
    </standardEndpoints> 
    </system.serviceModel> 

私はあることをstandardEndpointを修正しようとした:

<standardEndpoint name="TestService" helpEnabled="true" automaticFormatSelectionEnabled="true"> 
    <security mode="Transport"> 
    <transport clientCredentialType="Certificate" /> 
    </security> 
</standardEndpoint> 

しかし、それは助けにはなりませんでした。クライアント証明書を有効にするために何が欠けていますか?

+0

IISで同じ設定をマップしましたか? – Rajesh

答えて

2

標準バインディングをhepls

<dns value="localhost" /> 

希望のようなもの。バインディングの下で​​webHttpBindingに定義し、名前を付けないといけません。そうすれば、すべてのwebHttoBindingに適用されます。

<system.serviceModel> 
     <bindings> 
      <webHttpBinding> 
       <binding> 
        <security mode="Transport"> 
         <transport clientCredentialType="Certificate" /> 
        </security> 
       </binding> 
      </webHttpBinding> 
     </bindings> 
     <standardEndpoints> 
      <webHttpEndpoint> 
       <standardEndpoint name="TestService" helpEnabled="true" automaticFormatSelectionEnabled="true"/> 
      </webHttpEndpoint> 
     </standardEndpoints> 
    </system.serviceModel> 
0

configにDNSタブがありますか?これはその構文をサポートしていません

関連する問題