2014-09-26 143 views
0

我一直在嘗試將TLS添加到我創建的WCF服務中。 一切都還好,直到我嘗試通過https訪問服務而不是http。 當添加WCF服務的WCF測試客戶端,我得到這個:如何將TLS添加到WCF服務?

Error: Cannot obtain Metadata from [THELINK] If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at [an MS link] Exchange Error URI: [THELINK]
Metadata contains a reference that cannot be resolved: '[THELINK]'.
There was no endpoint listening at [THELINK] that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The remote server returned an error: (403) Forbidden.HTTP GET Error URI: [THELINK]
There was an error downloading '[THELINK]'. The request failed with HTTP status 403: Forbidden.

很抱歉的鏈接替換,但我新,我沒有名聲,似乎:)

問候, 莫滕

+0

所以你啓用元數據發佈您的HTTPS端點一些有用的信息? – 2014-09-26 10:50:02

+0

也許這對你有幫助嗎? http://blog.rsuter.com/?p=281 – 2014-09-26 12:20:07

+0

web.config將幫助 – nat 2014-09-26 12:44:55

回答

0

你有一個

<behaviors> <serviceBehaviors> <behavior name="YourSerivceBehaviourName"> <serviceMetadata httpsGetEnabled="true" /> <-- this bit ? ... ...

被引用

<service name="...." behaviorConfiguration="YourSerivceBehaviourName">

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
在你的web.config

測試客戶端也會呻吟,如果證書不是我發現的真實證書..即自我認證的測試。 但403似乎表明,無論您提供的憑據是不正確的,在SSL綁定中設置的clientCredentialType是什麼?

,如果你擊中的customErrors在瀏覽器中的鏈接會發生什麼情況.. 這可能會給你

相關問題