我正嘗試創建具有消息安全性的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