我正尝试创建具有消息安全性的Web服务。WCF在IIS上失败。系统找不到指定的文件
这里是一个配置:
<system.serviceModel>
<services>
<service name="WCFMessage.Service1" behaviorConfiguration="behaviour1">
<endpoint address="" contract="WCFMessage.IService1" binding="wsHttpBinding" bindingConfiguration="binding1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviour1">
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceMetadata httpGetEnabled="true"/>
<serviceCredentials>
<serviceCertificate findValue="MyCert"
x509FindType="FindBySubjectName"
storeLocation="LocalMachine"
storeName="My"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="binding1">
<security mode="Message">
<message clientCredentialType="None" negotiateServiceCredential="false"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>
它运作良好,在本地主机上,但在IIS上,它给了我一个错误:
The system cannot find the file specified.
堆栈跟踪:
It is likely that certificate 'CN=MyCert' may not have a private key that is capable of key exchange or the process may not have access rights for the private key.
我试过this方法,但仍然出现错误。
任何帮助表示赞赏。
感谢。我找到了解决方案,问题和你的一样。 – 2012-01-21 12:59:59