BindingElementsViewer

WCFでシステム標準のバインディングから作成されるバインディングエレメントの構成を表示するツールを作成しました。WCFサービスはバインディングから、 バインディングエレメントのコレクションが作成され、そこからチャネルリスナスタックが作成され、さらにそこからチャネルスタックが作成 されるます。といってもWCFをはじめたばかりでは標準のバインディングからどのようなバインディングエレメントが作成されるのかよくわからない と思います。私は今もわかっていませんが。というわけで、システムバインディングのプロパティを変更して、バインディングエレメントがどのように 作成されるのかを表示されるツールを作ってみました。残念ながら、セキュリティ設定などはデフォルトの構成しかできませんが。

システム動作図

実行例です。左上のコンボボックスからバインディングを選択し、左下のプロパティ(Encodingなど)を変更して、右上の表示ボタンをクリックすると現在の設定でバインディングエレメンツを作成した場合に作成されるバインディングエレメントのコレクションが表示されます。

システムバインディング構成の追加の仕方

構成ファイルの構成セクションにviewer.bindingsというセクションがありますので、keyにユニークな名前,valueに型情報を入力して下さい。下の内容は現在設定してある項目です。 key情報は表示される内容とは関係ありません。

<viewer.bindings>
    <add key="basicHttpBinding" value="System.ServiceModel.BasicHttpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="wsHttpBinding " value="System.ServiceModel.WSHttpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="wsDualHttpBinding" value="System.ServiceModel.WSDualHttpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="wsFederationHttpBinding" value="System.ServiceModel.WSFederationHttpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="netTcpBinding " value="System.ServiceModel.NetTcpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="netNamedPipeBinding " value="System.ServiceModel.NetNamedPipeBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="netPeerTcpBinding " value="System.ServiceModel.NetPeerTcpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="netMsmqBinding" value="System.ServiceModel.NetMsmqBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="msmqIntegrationBinding" value="System.ServiceModel.MsmqIntegration.MsmqIntegrationBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="ws2007HttpBinding" value="System.ServiceModel.WS2007HttpBinding, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add key="webHttpBinding" value="System.ServiceModel.WebHttpBinding, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
  </viewer.bindings>

ダウンロード

Version 1.0 BindingElementsViewer.zip

動作環境は次のとおりです。

動作環境 .NET 3.5以上がインストールされている環境

現在は標準のバインディングのプロパティのみしか変更できませんが、なにか提案があればご連絡下さい。