Problem creating a WCF service using Windsor

Does anyone know how to configure WCF using Windsor on IIS 7.0? I am using the latest from WCF Windsor and Windsor 2.1.1. Example http://www.castleproject.org/container/facilities/trunk/wcf/index.html is deprecated. Even the demo project in the WCF object does not mention how to configure the WCF service in IIS using the configuration, and I could not find any example where I can configure the WCF on the server side using the system.serviceModel section in the web.config file or even through the code. When I use the following code, it always creates basicHttpBinding, and I could not figure out how to configure the various bindings.

protected void Application_Start(object sender, EventArgs e)
{
    var returnFaults = new ServiceDebugBehavior
                           {
                               IncludeExceptionDetailInFaults = true,
                               HttpHelpPageEnabled = true
                           };

    var metadata = new ServiceMetadataBehavior {HttpGetEnabled = true};

    container = new WindsorContainer()
        .AddFacility<WcfFacility>()
        .Register(
            Component.For<IServiceBehavior>().Instance(returnFaults),
            Component.For<IServiceBehavior>().Instance(metadata),
            Component.For<IMyService>()
                     .Named("MyService")
                     .ImplementedBy<MyService>()
                     .LifeStyle.Transient
            );
}

And here is MyService.svc

<%@ ServiceHost Language="C#" Debug="true" Service="MyService" 
                Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration" %>
+3
source share
1

Windsor WCF. , Windsor; .

+3

Source: https://habr.com/ru/post/1748158/


All Articles