Ste*_*eve 10 wcf wshttpbinding
我正在尝试调用WCF服务.我创建了一个自签名证书并安装在我的localmachine\personnal\certificates中,我也在我的部分中添加了.但我不明白为什么会出现此错误.
这是我的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>
Run Code Online (Sandbox Code Playgroud)
但是当我尝试调用我的服务方法时抛出错误"未提供客户端证书.在ClientCredentials中指定客户端证书."
感谢您的建议以解决此错误?
Ste*_*eve 12
我忘了包含behaviorConfiguration ="CustomBehavior"
<endpoint address="https://abcdxyz.abc.syntax.com/TestCCService.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpEndpoint"
contract="TestCCService.ITestCCService" name="wsHttpEndpoint" **behaviorConfiguration="CustomBehavior"** />
Run Code Online (Sandbox Code Playgroud)
它现在正在工作.
谢谢你的帮助
| 归档时间: |
|
| 查看次数: |
20256 次 |
| 最近记录: |