开发者

How to set configuration on WCF when DI is used

开发者 https://www.devze.com 2023-02-17 14:52 出处:网络
I\'m using this method to achieve DI in WCF.Now I\'m at the point where I need to configure 开发者_JAVA百科the endpoints and bindings.

I'm using this method to achieve DI in WCF. Now I'm at the point where I need to configure 开发者_JAVA百科the endpoints and bindings.

How and where should I do this?


The comment by flq is provides the answer: you can still use the normal WCF configuration settings even if you use an IInstanceProvider.

Since this is the idiomatic way of configuring WCF I see no reason to do it in any other way. It provides flexibility, there's tool support, and you'd be using the documented API.


For windsor on the REST 4 template this is how I register the routes...

// SOAP Endpoint
RouteTable.Routes.Add(new ServiceRoute("myendpointname/soap",
    new WindsorServiceHostFactory<Castle.Facilities.WcfIntegration.DefaultServiceModel>(), typeof(IMyEndPointService)));

// REST Endpoint
RouteTable.Routes.Add(new ServiceRoute("myendpointname",
    new WindsorServiceHostFactory<RestServiceModel>(), typeof(IMyEndPointService)));
0

精彩评论

暂无评论...
验证码 换一张
取 消