简体   繁体   English

使用客户端证书将 WCF 服务引用添加到 Visual Studio 2022 项目

[英]Add WCF Service Reference to Visual Studio 2022 Project with Client Certificate

I am attempting to add a WCF Web Service reference to a C# project where the WSDL is secured behind a client certificate.我正在尝试将 WCF Web 服务引用添加到 C# 项目,其中 ZE7F674EE60F6AB14CZ35F6CEB 证书被保护I have successfully added the certificate to SOAPUI and made calls just fine, but when I attempt to add the reference in Visual Studio, I dont get prompted to select the certificate.我已成功将证书添加到 SOAPUI 并进行了很好的调用,但是当我尝试在 Visual Studio 中添加引用时,我没有收到 select 证书的提示。

How do I add a WCF Service endpoint which requires a client certificate in Visual Studio 2022 Community?如何在 Visual Studio 2022 社区中添加需要客户端证书的 WCF 服务端点?

Specify the client certificate using endpoint behavior like below:使用如下端点行为指定客户端证书:

<system.serviceModel>  
<behaviors>  
  <endpointBehaviors>  
    <behavior name="endpointCredentialsBehavior">  
      <clientCredentials>  
        <clientCertificate findValue="Cohowinery.com"
           storeLocation="LocalMachine"  
          x509FindType="FindBySubjectName" />  
      </clientCredentials>  
    </behavior>  
  </endpointBehaviors>  
</behaviors>
<bindings>  
  <wsHttpBinding>  
    <binding name="WSHttpBinding_ICalculator" >  
      <security mode="Message">  
        <message clientCredentialType="Certificate" />  
      </security>  
    </binding>  
  </wsHttpBinding>  
</bindings>  
<client>  
  <endpoint address="http://machineName/Calculator"
            behaviorConfiguration="endpointCredentialsBehavior"  
            binding="wsHttpBinding"  
            bindingConfiguration="WSHttpBinding_ICalculator"  
            contract="ICalculator"  
            name="WSHttpBinding_ICalculator">   
  </endpoint>  
</client> 

For more information, check out Message Security with a Certificate Client or Transport Security with Certificate Authentication .有关更多信息,请查看带有证书客户端的消息安全性带有证书身份验证的传输安全性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用netTcpBinding将WCF服务引用添加到客户端项目 - Can't add WCF service reference to client project using netTcpBinding 无法将WCF服务添加到Project Visual Studio 2017 - Cannot add WCF Service to Project Visual Studio 2017 如何将 wpf .net core exe 添加为 Visual Studio 2022 的项目引用以用作多个启动项目? - How can I add wpf .net core exe as project reference to visual studio 2022 for using as multiple startup project? 无法在 Visual Studio 2022 中添加基于服务的数据库 - Cannot add service based database in Visual Studio 2022 无法在Visual Studio 2010 IDE中添加启用HTTPS的WCF服务作为服务引用 - Not able to add HTTPS enabled WCF Service as Service reference in Visual Studio 2010 IDE Visual Studio 2019 16.11 - 无法在 netstandard 2.1 项目中更新或创建 WCF 服务引用 - Visual Studio 2019 16.11 - Can't update nor create WCF service reference in netstandard 2.1 project 无法在同一解决方案中为WCF项目的客户端类添加服务引用 - Can't add service reference to client class for WCF project within same solution 具有证书身份验证的WCF服务参考 - WCF service reference with certificate authentication WCF Web 服务/Visual Studio 社区 2022/编译器错误 CS0120 - WCF Web Service / Visual Studio Community 2022 / Compiler Error CS0120 无法在Visual Studio中添加服务引用 - Failing to add a service reference in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM