以前、.NET で Google 製シリアライズツール ProtocolBuffers が使えるようになるライブラリ protobuf-net を紹介しました。 Protocol Buffers を C# で遊んでみた - present この protobuf-net は WCF 向けの機能も提供していて、ProtocolBuffers でシリアル化したデータを WCF の通信で使うことができます。使い方を簡単に説明すると、ProtoBehaviorAttribute を OperationContractAttribute と一緒に指定してやるだけ。 using System; using System.ServiceModel; using ProtoBuf; using ProtoBuf.ServiceModel; namespace WcfProtoBufSample { //
![WCF で Protocol Buffers を使う方法 - present](https://cdn-ak-scissors.b.st-hatena.com/image/square/2bb645b2ded1f28c0f4a1f409e12558c33bbe1ed/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fg%2Fgriefworker%2F20100728%2F20100728170732.jpg)