日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[转] 关于 WCF 中数据压缩的几篇文章

發布時間:2023/12/19 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [转] 关于 WCF 中数据压缩的几篇文章 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原文:http://www.cnblogs.com/jiabao/archive/2007/12/04/982534.html
在.net3.0出現以前我們進行分布式開發式有兩個選擇一個是webservice,另一個是remoting;

在早期的項目中,比較喜歡remoting,因為remoting可控性好,也好部署,不需要依賴其他的宿主環境。 今年的做的項目大部分都是webservice的,因為在這幾年remoting過程中遇到了幾個問題,比較典型的就是remoting的宿主程序容易出現異常,并且這個異常很難捕捉,一旦宿主程序的壓力過大,就會出現這個情況。比較臉紅的是,這個問題到現在也沒有發現是怎么產生的,也就無從說解決了。

凡是涉及到分布式部署的項目都會有數據的傳輸問題:要對需要傳輸的數據進行壓縮。較早的項目中,都是將dataset壓縮為流對象(經過序列化的)后進行傳遞的,壓縮比1/4的樣子。

.net3.0的出現極大的方便了分布式項目的開發部署,在學習wcf時候,一直在尋找在wcf構架下的數據壓縮方案,就將搜集到一些文章匯總在這里(這方面的東西少的可憐),供大家參考。個人比較喜歡 WS-Compression for WCF 感覺思路更清晰

ms的文章:Custom Message Encoder: Compression Encoder
http://msdn2.microsoft.com/en-us/library/ms751458.aspx,例子在TechnologySamples、Extensibility、Channels、MessageEncoder、Compression目錄中

msdn社區的文章:Serialize Datasets as binary (not XML) in WCF
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1618046&SiteID=1&pageid=0#1648392
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1520385&SiteID=1,這里面Pablo Cibraro 的回復非常清晰,俺就摘錄在這里了

There are basically three ways to implement compression in WCF.

1. At transport level using a message encoder which compress all the data throughout the entire channel (From the client to the service). There is a sample of this in the WCF SDK, ?[SDK Folder]TechnologySamples/Extensibility/MessageEncoder/Compression

2. At message level, adding some metadata to the soap message?(Soap headers)?and compressing the soap body.?This approach?can use?a WCF binding or a MessageInspector Behavior to modify the soap messages.?You can find an example here, http://weblogs.asp.net/cibrax/archive/2006/03/29/WS_2D00_Compression-for-WCF.aspx

3. Only for the Http transport,?you can use the Http Compression capability.?I haven't seen any implementation of this technique so far.

I hope this can help you

Regards,

Pablo.

?

WS-Compression for WCF
http://weblogs.asp.net/cibrax/archive/2006/03/29/441398.aspx


繼續補充中...



--暢所欲言,隨心而談--
本博客文章全部原創,轉載請注明出處,謝謝
版權所有 jiabao.cnblogs.com 轉載請聯系

總結

以上是生活随笔為你收集整理的[转] 关于 WCF 中数据压缩的几篇文章的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。