WCF
IServiceBehavior †
IServiceBehaviorインタフェイスを利用して、サービス全体にわたる実行の一部の側面を、アプリケーション レベルで変更、確認ができます。
http://msdn.microsoft.com/ja-jp/library/system.servicemodel.description.iservicebehavior(VS.85).aspx
ServiceHostFactoryBase と ServiceHostFactory †
参照URL:
http://hyperthink.net/blog/servicehostfactory-vs-servicehostfactorybase/
ServiceHostFactoryBase †
もし直接 ServiceHostBase を継承して、カスタマイズしたホストを利用したい場合、ServiceHostFactoryBase を継承してやる。
you derive from ServiceHostFactoryBase directly if you're trying to use a custom host that derives directly from ServiceHostBase.
ServiceHostFactoryBase は ServiceHost の指示における Service 属性を通して、渡された不透明な文字列からServiceHostBasesを作成します。
ServiceHostFactoryBase creates ServiceHostBases from an opaque string passed in through the Service attribute in the @ServiceHost directive.
CLR型名以外の何かとしてService指示のそのコンテンツを解釈したいなら、ServiceHostFactoryBaseを継承して、あなたは、やりたい方法でその文字列を分析できます。
If you want to interpret that contents of the Service directive as something other than a CLR type name, you can derive from ServiceHostFactoryBase and parse that string in whatever way you want.
ServiceHostFactory †
もし ServiceHost を継承する代わりに、サービスホストをカスタマイズしたい場合、ServiceHostFactory を継承してやる。
If your custom service host instead derives from ServiceHost, you write a factory that derives from ServiceHostFactory.~
もし異なる ServiceHost の派生型を利用したい場合、ServiceHostFactory を継承して、自分のカスタマイズファクトリを作成する。
If you want to use a different subtype of ServiceHost, write your own factory that derives from ServiceHostFactory.
ServiceHostFactory をディフォルトファクトリとして用意され、CLR 型名として、コンストラクタを解釈する。ServiceHost の新しいインスタンスを作成する際に利用する。
We ship a default factory called ServiceHostFactory that interprets the constructor string as a CLR type name and uses that to create new instances of ServiceHost.
エンドポイントのランタイム動作を拡張 †
参考URL
http://msdn.microsoft.com/ja-jp/library/system.servicemodel.description.iendpointbehavior(VS.80).aspx
サービス アプリケーションで System.ServiceModel.Dispatcher.IDispatchMessageInspector を実装すれば、送受信する際に転送されてるデータをチェックできる。
System.ServiceModel.Configuration.BehaviorExtensionElement の実装は、構成ファイルからメッセージ インスペクタ動作を使用できるようにするためです。~
実装例:
// BehaviorExtensionElement members
public override Type BehaviorType
{
get { return typeof(EndpointBehaviorMessageInspector); }
}
protected override object CreateBehavior()
{
return new EndpointBehaviorMessageInspector();
}
構成ファイル中の設定:
<extensions>
<behaviorExtensions>
<add
name="endpointMessageInspector"
type="Microsoft.WCF.Documentation.EndpointBehaviorMessageInspector,HostApplication"
/>
</behaviorExtensions>
</extensions>
あなたのお住まいの地域で最安のブロードバンド選び
コメント:
|