.NET Compact Framework 3.5 支持 WCF 的子集

.NET Compact Framework 3.5 已經支持 Windows Communication Foundation (WCF)了,這是 .NET CF 3.5 最讓人興奮的特性之一。不過,.NET CF 版的 WCF 是 .NET Framework 3.5 版 WCF 的功能子集。MSDN Library for Visual Studio 2008 Beta 2 (Development Tools and Languages|Visual Studio|.NET Framework Programming in Visual Studio|.NET Compact Framework|Application Development|Windows Communication Foundation (WCF) Development|Messaging in the .NET Compact Framework) 中是這樣描述的:
The subset of Windows Communication Foundation (WCF) that is implemented in the .NET Compact Framework provides a unified programming model for building message-oriented applications. It enables developers to build secure messaging applications that work across platforms and that support interaction with existing WCF services on the desktop.
(譯文:.NET 精簡框架實現了 WCF 的子集,爲構建面向消息的應用程序提供了統一的編程模型。這使得開發人員能夠構建跨平臺的安全的消息應用程序,並且支持跟現有的運行在桌面平臺的 WCF 服務交互。)

WCF messaging layer on the .NET Compact Framework

Support for the WS-Security version 1.0 specification includes SOAP message security using X.509 certificates. The Message class is built on the WS-Addressing standard.

MSDN Library for Visual Studio 2008 Beta 2 對 Compact WCF 與 Desktop WCF 之間的差異描述得不夠詳盡,只是簡單描述了一下架構和安全方面的不同。

今天發現有人整理了一個比較詳細的表格,供大家參考:

Feature

Desktop WCF

Compact WCF

Bindings:    
· BasicHttpBinding Yes Yes
· CustomBinding Yes Yes
· WindowsMobileMailBinding N/A Yes
· ExchangeWebServiceMailBinding Yes, via NetCF install Yes
Formatters:    
· SoapFormatter Yes Yes
· BinaryFormatter Yes No
Encoders:    
· TextMessageEncoder Yes Yes
· BinaryMessageEncodingBindingElement Yes No
· MTOMEncoder Yes No
· GzipEncoder Sample available Sample available
Transports:    
· HttpTransportBindingElement Yes Yes
· HttpsTransportBindingElement Yes Yes
· MailTransportBindingElement Yes, via NetCF install Yes
· MsmqTransportBindingElement Yes No
· TcpTransportBindingElement Yes No
· (other transports)  Yes No 
XmlDictionaryReader/Writer Yes Yes; stub around XmlTextReader/Writer
DataContractSerializer Yes No; but can be wire-compatible with DCS via XmlSerializer
Service proxy generation Yes; via SvcUtil.exe Yes; via NetCFSvcUtil.exe, not integrated into VS2008
· Non-HTTP transports Yes No
· Custom headers Yes No
WS-Addressing Yes Yes
WS-Security message level security    
· X.509 Yes Yes
· Username/password Yes No
· SecurityAlgorithmSuite.Basic256Rsa15 Yes Yes
· SecurityAlgorithmSuite.Basic256 Yes No
WS-ReliableMessaging Yes No
Patterns    
· Service model Yes No
· Message layer programming Yes Yes
· Buffered messages Yes Yes
· Streaming messages Yes No
· Endpoint descriptions in .config files Yes No
Channel extensibility Yes Yes
Security channel extensibility Yes No

其中 Mail Binding 是很有意思的一個特性,我以前的隨筆有提過。不過這個功能需要跟 Exchange Server 配合使用,有一定的侷限性。WCF Exchange Server Mail Transport 使用方法可以參考 MSDN 文檔。
發佈了96 篇原創文章 · 獲贊 1 · 訪問量 43萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章