Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

簡介

Windows 通訊基礎 (WCF) 並沒有傳送安全的郵件,然後接收無安全性的回應,或是來傳送無安全性的訊息及接收安全的回覆功能。本文所述的 hotfix 會新增新的enableUnsecuredResponse屬性。EnableUnsecuredResponse屬性的預設值為false。如果您設定這個屬性的值為true時,下列的新功能會啟用 WCF 中︰

  • WCF 用戶端可以接受無安全性的回應,即使外寄的郵件都會受到使用安全通訊端層 (SSL) 通訊協定來簽署訊息主體。

  • WCF 服務可以傳送無安全性在 SOAP 信封中有沒有安全性標頭,即使在安全要求的回應。

注意EnableUnsecuredResponse屬性僅只適用於CustomBinding型別。

解決方案

如果您使用.NET Framework 3.0,安裝下列 「 Microsoft 知識基礎文件所述的 hotfix:

967105修正︰ hotfix,可讓 WCF 將受保護的訊息傳送和接收無安全性的回應,並傳送無安全性的訊息及接收安全的回應,適用於.NET Framework 3.0如果您在 Windows 7 或 Windows Server 2008 R2 使用.NET Framework 3.5 Service Pack 1,安裝下列 「 Microsoft 知識基礎文件所述的 hotfix:

977420 hotfix 彙總套件都可以使用 Windows 通訊基礎,在.NET Framework 3.5 SP1 的 Windows 7 及 Windows Server 2008 R2 中修正的問題
如果您在其他作業系統上使用.NET Framework 3.5 Service Pack 1,安裝下列 hotfix 以解決這個問題。

已經可以從 Microsoft 取得支援的 hotfix。不過,其旨在修正本文所述的問題。它只適用於發生此特定問題的系統上。此 hotfix 可能會接受其他測試。因此,如果這個問題不會嚴重影響,我們建議您等候下一個包含此 hotfix 的 service pack。

若要立即解決這個問題,請連絡 Microsoft 客戶支援服務 」 取得 hotfix。如需 Microsoft 客戶支援服務電話號碼以及支援費用的相關資訊的完整清單,請造訪下列 Microsoft 網站︰

http://support.microsoft.com/contactus/?ws=support注意在特殊的情況下,如果 Microsoft 支援專業人員認為某特定更新程式可以解決您的問題時,可能就不會收取一般因支援電話所產生的費用。收取支援費用會套用,如果有其他支援問題是,不能限定的特定更新程式。

先決條件

若要套用此 hotfix 之後,您必須擁有.NET Framework 3.5 Service Pack 1。

重新啟動需求

您不必重新啟動電腦,如果正在使用沒有.NET Framework 的執行個體,會套用此 hotfix 之後。

Hotfix 取代資訊

此 hotfix 不會取代任何其他 hotfix。

檔案資訊

此 hotfix 的英文版具有下列表格中所列檔案屬性 (或較新的檔案屬性)。這些檔案的日期和時間會以國際標準時間 (UTC) 格式列出。當您檢視檔案資訊時,會將它轉換為本地時間。若要查看 UTC 與當地時間的時差,請在 [控制台] 中的日期和時間項目使用 [時區] 索引標籤。

檔案資訊以 x86 為基礎的所有版本的 Windows XP 和 Windows Server 2003 的

檔案名稱

檔案版本

檔案大小

日期

時間

平台

Servicemonikersupport.dll

3.0.4506.4119

17,240

2009 年 6 月 01 日

22:56

x86

System.runtime.serialization.dll

3.0.4506.4119

970,752

2009 年 6 月 01 日

22:56

x86

System.servicemodel.dll

3.0.4506.4119

5,931,008

2009 年 6 月 01 日

22:56

x86

檔案資訊 x64 為主的所有版本的 Windows XP 和 Windows Server 2003 的

檔案名稱

檔案版本

檔案大小

日期

時間

平台

Servicemonikersupport.dll

3.0.4506.4119

19,304

2009 年 6 月 01 日

22:28

x64

System.runtime.serialization.dll

3.0.4506.4119

847,872

2009 年 6 月 01 日

22:28

x64

System.servicemodel.dll

3.0.4506.4119

5,267,456

2009 年 6 月 01 日

22:28

x64

檔案資訊以 x86 為基礎的所有版本和 Windows Server 2008 SP2 的 Windows Vista SP2

檔案名稱

檔案版本

檔案大小

日期

時間

Servicemonikersupport.dll

3.0.4506.4120

17,240

10-Jun-2009

06:55

System.runtime.serialization.dll

3.0.4506.4120

970,752

10-Jun-2009

06:55

System.servicemodel.dll

3.0.4506.4120

5,935,104

10-Jun-2009

06:55

檔案資訊所有 x64 為主的版本和 Windows Server 2008 SP2 的 Windows Vista SP2

檔案名稱

檔案版本

檔案大小

日期

時間

平台

Servicemonikersupport.dll

3.0.4506.4120

19,288

10-Jun-2009

06:56

x64

System.runtime.serialization.dll

3.0.4506.4120

847,872

10-Jun-2009

06:56

x64

System.servicemodel.dll

3.0.4506.4120

5,271,552

10-Jun-2009

06:56

x64

所有 itanium 型版本的 Windows Server 2008 的 SP2 檔案資訊

檔案名稱

檔案版本

檔案大小

日期

時間

平台

Servicemonikersupport.dll

3.0.4506.4120

33,640

10-Jun-2009

06:56

IA-64

System.runtime.serialization.dll

3.0.4506.4120

847,872

10-Jun-2009

06:56

IA-64

System.servicemodel.dll

3.0.4506.4120

5,271,552

10-Jun-2009

06:56

IA-64

狀態

Microsoft 已確認這是<套用>一節所列出的 Microsoft 產品的問題。

更多的資訊

若要測試的enableUnsecuredResponse屬性使用下列的範例程式碼︰

服務

BindingElementCollection serviceBec = new BindingElementCollection();
SecurityBindingElement serviceSbe = SecurityBindingElement.CreateUserNameForCertificateBindingElement();
serviceSbe.EnableUnsecuredResponse = true;
serviceBec.Add(serviceSbe);
serviceBec.Add(new TextMessageEncodingBindingElement());
serviceBec.Add(new HttpTransportBindingElement());
Binding serviceBinding = new CustomBinding(serviceBec);

ServiceHost serviceHost = new ServiceHost(typeof(RequestReply));

serviceHost.Open();

用戶端

BindingElementCollection clientBec = new BindingElementCollection();
SecurityBindingElement clientSbe = SecurityBindingElement.CreateUserNameForCertificateBindingElement();
clientSbe.EnableUnsecuredResponse = true;
clientBec.Add(clientSbe);
clientBec.Add(new TextMessageEncodingBindingElement());
clientBec.Add(new HttpTransportBindingElement());
Binding clientBinding = new CustomBinding(clientBec);

IRequestReply channel = cf.CreateChannel();
try
{
channel.SendString("Hello");
cf.Close();
}

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×