[英]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.