修正:當你執行使用 SSL 認證客戶端憑證的 IIS 託管 WCF 服務時,會拋出 System.NotSupportedException 例外

套用到
.NET Framework 3.5 Service Pack 1

症狀

請考慮以下案例:

  • 你建立一個 Windows 通訊基金會 (WCF) 服務,該服務託管於 IIS) 的 Internet Information Services (。
  • 你可以在 WCF 服務中使用 WebScriptEnablingBehavior 類別。
  • 你可以設定 WCF 服務使用用戶端憑證來進行安全套接層 (SSL) 認證。 為此,你在 Web.config 檔案中將 ClientCredentialType 屬性設為 Certificate。

在此情境中,當你執行 WCF 服務時,會拋出 System.NotSupportedException 例外,並收到類似以下錯誤訊息:

注意

服務「None」的 SSL 設定與 IIS 的「Ssl、SslNegotiateCert、SslRequireCert、SslMapCert、Ssl128」不符。

原因

此問題是因為 HttpTransportBindingElement 實例的某些屬性未被複製到自動產生的 JavaScript 代理端點。

解決方式

Microsoft 現在已經支援熱修補程式。 然而,本文僅旨在修正本文所描述的問題。 只應用在遇到這個特定問題的系統上。

要解決此問題,請聯絡 Microsoft 客服以取得熱修補程式。 欲查詢完整的 Microsoft 客服電話及支援費用資訊,請造訪以下 Microsoft 網站:

http://support.microsoft.com/contactus/?ws=support注意:在特殊情況下,若 Microsoft 支援服務專業人員認定特定更新能解決您的問題,通常會因客服電話產生的費用被取消。 一般來說,如果有所描述之特定更新無法解決的其他支援問題,才會收取支援費用。

先決條件

你必須安裝 .NET Framework 3.5 Service Pack 1 (SP1) 才能套用這個熱修補。

重新啟動需求

安裝熱修補程式後,你不需要重啟電腦。

熱修正更換資訊

這個熱修正不會取代其他熱修正。
  此熱修正的英文版本包含以下表格中列出的檔案屬性 (或更新版本的檔案屬性) 。 這些檔案的日期與時間是以國際標準時間 (UTC) 表示。 當您檢視檔案資訊時,它會轉換成當地時間。 若要查看 UTC 與當地時間的差異,請使用 [控制台] 中 [日期和時間] 項目的 [時區] 索引標籤。

基於 x86 的版本,適用於 Windows Server 2000、Windows Server 2003 及 Windows XP

檔案名稱 檔案版本 檔案大小 日期 時間 平台
System.servicemodel.web.dll 3.5.594.4152 569,344 22-Jul-2009 01:51 x86

              

基於 x64 的版本,適用於 Windows Server 2000、Windows Server 2003 及 Windows XP

檔案名稱 檔案版本 檔案大小 日期 時間 平台
System.servicemodel.web.dll 3.5.594.4152 491,520 22-Jul-2009 02:13 x64

              

基於 Itanium 的版本,適用於 Windows Server 2000、Windows Server 2003 及 Windows XP

檔案名稱 檔案版本 檔案大小 日期 時間 平台
System.servicemodel.web.dll 3.5.594.4152 491,520 22-Jul-2009 02:26 IA-64

              

狀態

Microsoft 已確認這是「適用對象」一節中列出的 Microsoft 產品中的問題。

因應措施

為了解決這個問題,請自行架設 WCF 服務,而不是在 IIS 中架設服務。

更多資訊

堆疊傾印資訊

System.ServiceModel.dll!System.ServiceModel.Channels.HttpsChannelListener.ApplyHostedContext(System.ServiceModel.Activation.VirtualPathExtension virtualPathExtension, bool isMetadataListener) + 0x1b7 bytes    

System.ServiceModel.dll!System.ServiceModel.Channels.HttpsTransportBindingElement.BuildChannelListener<System.__Canon>(System.ServiceModel.Channels.BindingContext context) + 0x69 bytes    

  System.ServiceModel.dll!System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener<System.__Canon>() + 0x5f bytes       

System.ServiceModel.dll!System.ServiceModel.Channels.MessageEncodingBindingElement.InternalBuildChannelListener<System.__Canon>(System.ServiceModel.Channels.BindingContext context) + 0x66 bytes    

System.ServiceModel.Web.dll!System.ServiceModel.Channels.WebScriptMetadataMessageEncodingBindingElement.BuildChannelListener<System.__Canon>(System.ServiceModel.Channels.BindingContext context) + 0x4b bytes    

  System.ServiceModel.dll!System.ServiceModel.Channels.BindingContext.BuildInnerChannelListener<System.__Canon>() + 0x5f bytes       

        System.ServiceModel.dll!System.ServiceModel.Channels.Binding.BuildChannelListener<System.__Canon>(System.Uri listenUriBaseAddress, string listenUriRelativeAddress, System.ServiceModel.Description.ListenUriMode listenUriMode, System.ServiceModel.Channels.BindingParameterCollection parameters) + 0xa6 bytes 

        System.ServiceModel.dll!System.ServiceModel.Channels.Binding.BuildChannelListener<System.__Canon>(System.Uri listenUriBaseAddress, System.ServiceModel.Channels.BindingParameterCollection parameters) + 0x7c bytes    

System.ServiceModel.Web.dll!System.ServiceModel.Description.WebScriptEnablingBehavior.AddMetadataEndpoint(System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher, bool debugMode) + 0x698 bytes 

System.ServiceModel.Web.dll!System.ServiceModel.Description.WebScriptEnablingBehavior.ApplyDispatchBehavior(System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher) + 0x60 bytes