2012-04-10 4 views
0

J'ai un service REST que j'aimerais demander aux clients. Le system.serviceModel se présente comme suit:Ajout de certificats clients à un 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> 

J'ai essayé de modifier le standardEndpoint être:

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

Mais cela n'a pas aidé. Qu'est-ce qui me manque pour activer les certificats clients?

+0

Avez-vous mappé le même paramètre sur IIS? – Rajesh

Répondre

2

fixations standard ne prennent pas en charge cette syntaxe. Vous devez le définir sur le webHttpBinding sous les liaisons et ne lui donner aucun nom. De cette façon, il s'applique à tous les webHttoBinding (s).

<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

avez-vous un onglet DNS dans la configuration? quelque chose comme

<dns value="localhost" /> 

espoir ce hepls

Questions connexes