From 103ad60d97ad077eacfaecc570b45622af44c098 Mon Sep 17 00:00:00 2001 From: cneuwirt Date: Wed, 2 Apr 2008 15:06:32 +0000 Subject: [PATCH] Allow BaseAddresses to be supplied when resolving service hosts. git-svn-id: https://svn.castleproject.org/svn/castle/trunk@4984 73e77b4c-caa6-f847-a29a-24ab75ae54b6 --- .../Service/WcfServiceExtension.cs | 14 ++++++++------ .../Service/WindsorServiceHostFactory.cs | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WcfServiceExtension.cs b/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WcfServiceExtension.cs index 7c202132c..ad8c1af10 100644 --- a/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WcfServiceExtension.cs +++ b/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WcfServiceExtension.cs @@ -33,13 +33,14 @@ namespace Castle.Facilities.WcfIntegration #region ServiceHostBuilder Delegate Fields private delegate ServiceHost CreateServiceHostDelegate( - IKernel kernel, IWcfServiceModel serviceModel, ComponentModel model); + IKernel kernel, IWcfServiceModel serviceModel, ComponentModel model, + Uri[] baseAddresses); private static readonly MethodInfo createServiceHostMethod = typeof(WcfServiceExtension).GetMethod("CreateServiceHostInternal", BindingFlags.NonPublic | BindingFlags.Static, null, new Type[] { typeof(IKernel), typeof(IWcfServiceModel), - typeof(ComponentModel) }, null + typeof(ComponentModel), typeof(Uri[]) }, null ); private static readonly Dictionary @@ -138,7 +139,7 @@ namespace Castle.Facilities.WcfIntegration #region CreateServiceHost Members public static ServiceHost CreateServiceHost(IKernel kernel, IWcfServiceModel serviceModel, - ComponentModel model) + ComponentModel model, params Uri[] baseAddresses) { CreateServiceHostDelegate createServiceHost; @@ -163,16 +164,17 @@ namespace Castle.Facilities.WcfIntegration locker.ReleaseLock(); } - return createServiceHost(kernel, serviceModel, model); + return createServiceHost(kernel, serviceModel, model, baseAddresses); } internal static ServiceHost CreateServiceHostInternal(IKernel kernel, IWcfServiceModel serviceModel, - ComponentModel model) + ComponentModel model, + params Uri[] baseAddresses) where M : IWcfServiceModel { IServiceHostBuilder serviceHostBuilder = kernel.Resolve>(); - return serviceHostBuilder.Build(model, (M)serviceModel); + return serviceHostBuilder.Build(model, (M)serviceModel, baseAddresses); } #endregion diff --git a/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WindsorServiceHostFactory.cs b/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WindsorServiceHostFactory.cs index f5bafe89b..5791715ea 100644 --- a/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WindsorServiceHostFactory.cs +++ b/Facilities/Wcf/Castle.Facilities.WcfIntegration/Service/WindsorServiceHostFactory.cs @@ -73,7 +73,8 @@ namespace Castle.Facilities.WcfIntegration if (serviceModel != null) { - return WcfServiceExtension.CreateServiceHost(kernel, serviceModel, componentModel); + return WcfServiceExtension.CreateServiceHost(kernel, serviceModel, + componentModel, baseAddresses); } else { -- 2.11.4.GIT