2013-03-27 17 views
9

Próbuję wywołać usługę WCF .Przygotowałem samokreślony certyfikat i zainstalowałem go w moich plikach localmachine \ personnal \, a także dodałem to w mojej sekcji .Jednak nie rozumiem, dlaczego ten błąd jest .Błąd WCF Certyfikat klienta nie jest dostarczany. Określ certyfikat klienta w ClientCredentials

Oto moja web.config

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
     <bindings> 
      <wsHttpBinding> 
       <binding name="wsHttpEndpoint"> 
        <security mode="Transport"> 
         <transport clientCredentialType="Certificate" /> 
        </security> 
       </binding> 
      </wsHttpBinding> 
     </bindings> 
     <client> 
      <endpoint address="https://abcdxyz.abc.syntax.com/TestCCService.svc" 
       binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint" 
       contract="TestCCService.ITestCCService" name="wsHttpEndpoint" /> 
     </client> 

     <behaviors> 
      <endpointBehaviors> 
       <behavior name="CustomBehavior"> 
        <clientCredentials> 
         <clientCertificate findValue="abc.mymachine.name.com" x509FindType="FindBySubjectName" 
          storeLocation="LocalMachine" storeName="My" /> 
         </clientCredentials> 
       </behavior> 
      </endpointBehaviors> 
     </behaviors> 

    </system.serviceModel> 
</configuration> 

ale gdy próbuję zadzwonić moja metoda usługa jego błędy rzucanie „Świadectwo klient nie jest przewidziane. Określ certyfikat klienta w ClientCredentials”.

Doceń swoje sugestie, aby rozwiązać ten błąd?

+0

WCF twierdzi, że nie masz certyfikatu klienta pasującego do "abc.mymachine.name.com"; jesteś pewien, że utworzyłeś go poprawnie? –

+0

Tak Mam zainstalowany certyfikat "abc.mymachine.name.com". – Steve

Odpowiedz

9

I miised zawierać behaviorConfiguration = "CustomBehavior"

<endpoint address="https://abcdxyz.abc.syntax.com/TestCCService.svc" 
       binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint" 
       contract="TestCCService.ITestCCService" name="wsHttpEndpoint" **behaviorConfiguration="CustomBehavior"** /> 

i jego pracy teraz.

Dziękujemy za pomoc

Powiązane problemy