未为目标“###”提供服务证书 在 ClientCredentials 中指定服务证书

2024-02-05

我已经实现了一个测试客户端/服务器,它实现了UserName通过 WCF 进行消息身份验证。它almost一切顺利,但我在最后一个障碍处摔倒了。

我得到一个InvalidOperationException上面写着

未为目标“http://localhost:8732/Design_Time_Addresses/EvalServiceLibrary/Service1/”提供服务证书。在 ClientCredentials 中指定服务证书。

任何人都可以阐明吗?

Thanks


在你的中包含这样的东西client配置文件:

<client>
 <endpoint address="http://example.com/Myservice.svc"
        binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
        contract="Core.IService" name="WSHttpBinding_IService" behaviorConfiguration="myServiceBehaviour" >
   <identity>
    <dns value="SampleServiceCertificate"/>
   </identity>
 </endpoint>
</client>
    <behaviors>
      <endpointBehaviors>
        <behavior name="myServiceBehaviour">
          <clientCredentials>
            <serviceCertificate>
              <defaultCertificate storeLocation="LocalMachine" storeName="My" findValue="SampleServiceCertificate" x509FindType="FindBySubjectName"  />
            </serviceCertificate>
          </clientCredentials>
        </behavior>            
      </endpointBehaviors>          
    </behaviors>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

未为目标“###”提供服务证书 在 ClientCredentials 中指定服务证书 的相关文章

随机推荐