2012-07-16 65 views
2

我使用的客戶端和服務器這樣綁定配置:basicHttpBinding的與TransportWithMessageCredential和clientCredentialType =「視窗」

<basicHttpBinding> 
    <binding name="BasicHttpBinding_IService1"> 
     <security mode="TransportWithMessageCredential"> 
      <transport clientCredentialType="Windows" /> 
     </security> 
    </binding> 
</basicHttpBinding> 

客戶端憑證似乎不能自動地通過(或者是他們?)這樣,像我假定,所以我需要知道如何自己設置它們。這甚至會起作用嗎?

回答

3

您必須啓用Windows身份驗證IIS。看看下面的鏈接,瞭解如何做到這一點。

另外,我檢查了MSDN網站,你的配置之間和MSDN上的關鍵的區別是安全模式

<bindings> 
    <basicHttpBinding> 
    <binding name="BasicHttpEndpointBinding"> 
     <security mode="TransportCredentialOnly"> 
     <transport clientCredentialType="Windows" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
</bindings> 

唯一的區別是,你可以看到模式。我不確定這會解決您的問題,但可以放棄。

下面是所有「服務綁定」中的5種可能的「安全模式」。

- 關閉安全。

傳輸 - 使用「傳輸安全性」進行相互驗證和消息保護。

消息 - 使用「消息安全性」進行相互驗證和消息保護。

Both - 允許您提供傳輸和消息級安全設置(僅MSMQ支持此設置)。

TransportWithMessageCredential - 憑據與消息和消息保護和服務器認證通過由傳輸層提供 。

TransportCredentialOnly - 客戶端憑證與傳輸層一起傳遞,並且不應用消息保護。

+0

我已經在IIS中激活了Windows身份驗證。我甚至無法將服務引用添加到像這樣配置的WCF服務。 – UrbanEsc 2012-07-16 11:19:55

+0

如果您將我們的服務配置爲使用BasicHttpBinding,那麼您將無法添加服務引用,因爲通過使用此綁定,實際上並未使用SOAP。對於基於非肥皂的服務,您無法生成元數據 – Anand 2012-07-16 11:22:43

+0

請參閱http://stackoverflow.com/questions/11390594/failed-to-add-a-service-service-metadata-may-not-be-accessible-make -sure-your/11392842#11392842 – Anand 2012-07-16 11:23:20

相關問題