Customization of WCF Integration Facility

119 views
Skip to first unread message

fredlegrain

unread,
Feb 4, 2010, 10:50:02 AM2/4/10
to Castle Project Users
I'd like to customize WCF Integration Facility to make capable of
exposing a service host based on a provided ServiceContract interface
and handling calls through a provided interceptor.

Let's say I have a ServiceContract interface :

[ServiceContract]
public interface IHelloService {
[OperationContract]
string SayHello(string message);
}

Let's says I don't have (and don't want to have) any implementation of
IHelloService.
But I have an interceptor (let's call it HelloServiceInterceptor)
which knows how to answer the service calls.

I'd like to have my init code look like this :

container.Register(Component
.For(typeof(IHelloService))
.Interceptors(typeof(HelloServiceInterceptor)).First
.ActAs(new DefaultServiceModel()
.AddEndpoints(WcfEndpoint
.BoundTo(new BasicHttpBinding())
.At("http://localhost:6080/HelloService/")
)
)
);

Do you expect that be feasible?
How can I customize Windsor and/or WCF Integration Facility to achieve
that?
Maybe a custom ServiceModel would allow me to do the job?

Cheers,
Frédéric

Craig Neuwirt

unread,
Feb 4, 2010, 6:43:15 PM2/4/10
to castle-pro...@googlegroups.com
What error do you get when you do this?


--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.
To post to this group, send email to castle-pro...@googlegroups.com.
To unsubscribe from this group, send email to castle-project-u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.


Frédéric Legrain

unread,
Feb 5, 2010, 4:57:40 AM2/5/10
to castle-pro...@googlegroups.com
Actually I get no error when I register.
But nothing seems to come out, service is not available...

If I try getting a service client from the same container, I get an exception:
"ComponentActivator: could not proxy HelloModule.IHelloService" > "The interceptor could not be resolved".



2010/2/5 Craig Neuwirt <cneu...@gmail.com>

Craig Neuwirt

unread,
Feb 5, 2010, 7:57:44 AM2/5/10
to castle-pro...@googlegroups.com
You need to register the HelloServiceInterceptor too.

2010/2/5 Frédéric Legrain <f.le...@gmail.com>

Frédéric Legrain

unread,
Feb 8, 2010, 4:53:41 AM2/8/10
to castle-pro...@googlegroups.com
Right. Now resolve works using the same container. Thank you.

Yet, remote WCF calls still don't work. This looks like WCF Facility do not expose services that have no implementation.



2010/2/5 Craig Neuwirt <cneu...@gmail.com>

Craig Neuwirt

unread,
Feb 8, 2010, 8:11:18 AM2/8/10
to castle-pro...@googlegroups.com
That doesn't make sense to me.  Are you getting an exception?  Can you send me a test case to demonstrate?

thanks,
 craig

2010/2/8 Frédéric Legrain <f.le...@gmail.com>

Frédéric Legrain

unread,
Feb 8, 2010, 10:23:23 AM2/8/10
to castle-pro...@googlegroups.com
Here it is : just copy/paste in a Console application with the required references (see usings, i'm working with trunk of WCF Integration).

Tanks,
Frédéric

--------------------------------------------

using System;
using Castle.Windsor;
using Castle.Facilities.WcfIntegration;
using Castle.MicroKernel.Registration;
using System.ServiceModel.Description;
using System.ServiceModel;
using Castle.Core.Interceptor;

namespace WcfIntegration.ConsoleDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Scenarios.InterceptorOnly.Run();
        }
    }
}

namespace WcfIntegration.ConsoleDemo.Scenarios
{
    class InterceptorOnly
    {
        public static void Run()
        {
            System.Diagnostics.Debug.WriteLine("Running interceptor-only Scenario");

            // SERVICE: Setup container with WCF facility
            IWindsorContainer container;
            container = new WindsorContainer()
                .AddFacility<WcfFacility>();

            // SERVICE: Register WCF metadata logic
            container.Register(Component
                .For<IServiceBehavior>()
                .Instance(new ServiceMetadataBehavior() { HttpGetEnabled = true })
                );

            // SERVICE: Register interceptor
            container.Register(Component.For<Misc.HelloInterceptor>());

            // SERVICE: Register IHelloService with explicit implementation (HelloServiceImpl)
            container.Register(Component
                .For(typeof(HelloService.IHelloService))
                .Interceptors(typeof(Misc.HelloInterceptor))
                // NO EXPLICIT IMPLEMENTATION .ImplementedBy<Misc.HelloServiceImpl>()
                .ActAs(new DefaultServiceModel()
                    .AddBaseAddresses("http://localhost:6080/HelloService/")
                    .AddEndpoints(WcfEndpoint.BoundTo(new BasicHttpBinding()))
                    )
                );

            // SERVICE: test get service from same container
            container.Resolve<HelloService.IHelloService>().Hello();


            // CLIENT:
            HelloService.IHelloService client;
            client = ChannelFactory<HelloService.IHelloService>.CreateChannel(
                new BasicHttpBinding(),
                new EndpointAddress("http://localhost:6080/HelloService/")
                );
            client.Hello();


            // DISPOSE:
            container.Dispose();
        }
    }
}

namespace WcfIntegration.ConsoleDemo.HelloService
{

    [ServiceContract]
    public interface IHelloService
    {
        [OperationContract]
        HelloReply HelloInOut(HelloMessage request);

        [OperationContract]
        void HelloIn(HelloMessage request);

        [OperationContract]
        HelloReply HelloOut();

        [OperationContract]
        void Hello();
    }

    public class HelloMessage
    {
        public string HelloText;
        public DateTime HelloTime;
        public Smile[] Smiles;
    }

    public class Smile
    {
        public string Description;
        public bool ShowTeeth;
    }

    public class HelloReply
    {
        public string HelloResponse;
        public double SmileFactor;
    }
}

namespace WcfIntegration.ConsoleDemo.Misc
{
    public class HelloInterceptor : IInterceptor
    {
        public HelloInterceptor()
        { }

        #region IInterceptor Members

        public void Intercept(IInvocation invocation)
        {
            System.Diagnostics.Debug.WriteLine(string.Format("HelloInterceptor: {0} @ {1}", invocation.Method.Name, DateTime.Now.ToLongTimeString()));
            // DO THE IHelloService BUSINESS
        }

        #endregion
    }
}

--------------------------------------------


2010/2/8 Craig Neuwirt <cneu...@gmail.com>

Craig Neuwirt

unread,
Feb 8, 2010, 10:27:28 AM2/8/10
to castle-pro...@googlegroups.com
Thanks,
  I'll take a look when a get a free moment.

2010/2/8 Frédéric Legrain <f.le...@gmail.com>

Frédéric Legrain

unread,
Feb 8, 2010, 10:38:27 AM2/8/10
to castle-pro...@googlegroups.com
You're welcome, thanks you for your time.
About the exception, I get it when trying to call the service (line " client.Hello(); " -> server actively refused connection )

I am considering providing my own customized IWcfServiceHost and/or AbstractServiceHostBuilder and/or WcfServiceModel
to support the feature (expose WCF service with only an interceptor to handle the requests).

Cheers,
Frédéric


2010/2/8 Craig Neuwirt <cneu...@gmail.com>

Craig Neuwirt

unread,
Feb 8, 2010, 10:40:44 AM2/8/10
to castle-pro...@googlegroups.com


2010/2/8 Frédéric Legrain <f.le...@gmail.com>

You're welcome, thanks you for your time.
About the exception, I get it when trying to call the service (line " client.Hello(); " -> server actively refused connection )

I am considering providing my own customized IWcfServiceHost and/or AbstractServiceHostBuilder and/or WcfServiceModel
to support the feature (expose WCF service with only an interceptor to handle the requests).


I would think this is supported automatically.  I'll check it out

 

Craig Neuwirt

unread,
Feb 10, 2010, 2:47:23 PM2/10/10
to castle-pro...@googlegroups.com
Definitely a limitation.  Working with Krzysztof to find the best solution.

Krzysztof Koźmic

unread,
Feb 10, 2010, 3:46:32 PM2/10/10
to castle-pro...@googlegroups.com
Frédéric, good news!

I was able to build a working proof-of-concept solution based on DynamicProxy and WCF only.
We'll take a look at bringing this functionality to WCF Facility now.

Krzysztof

Frédéric Legrain

unread,
Feb 11, 2010, 4:39:44 AM2/11/10
to castle-pro...@googlegroups.com
Krzysztof,
Good news you consider adding the feature to WCF Facility.
I also already have a solution working with DP, just could'nt figure out if WCF Facility was already capable of it.

Can I help on this one?
I was considering providing my own customized IWcfServiceHost and/or AbstractServiceHostBuilder and/or WcfServiceModel
to support the feature. Or do you consider adding this to the DefaultServiceHost/HostBuilder/Model ?

Frédéric



2010/2/10 Krzysztof Koźmic <krzyszto...@gmail.com>

Krzysztof Koźmic

unread,
Feb 11, 2010, 11:44:15 AM2/11/10
to castle-pro...@googlegroups.com
I dont know how to best go about it.

Craig?


On 2010-02-11 10:39, Fr�d�ric Legrain wrote:
Krzysztof,
Good news you consider adding the feature to WCF Facility.
I also already have a solution working with DP, just could'nt figure out if WCF Facility was already capable of it.

Can I help on this one?
I was considering providing my own customized IWcfServiceHost and/or AbstractServiceHostBuilder and/or WcfServiceModel
to support the feature. Or do you consider adding this to the DefaultServiceHost/HostBuilder/Model ?

Fr�d�ric



2010/2/10 Krzysztof Ko�mic <krzyszto...@gmail.com>
Fr�d�ric, good news!


I was able to build a working proof-of-concept solution based on DynamicProxy and WCF only.
We'll take a look at bringing this functionality to WCF Facility now.

Krzysztof


On 2010-02-10 20:47, Craig Neuwirt wrote:
Definitely a limitation.ďż˝ Working with Krzysztof to find the best solution.

thanks,
ďż˝ craig

2010/2/8 Fr�d�ric Legrain <f.le...@gmail.com>
You're welcome, thanks you for your time.
About the exception, I get it when trying to call the service (line " client.Hello(); " -> server actively refused connection )

I am considering providing my own customized IWcfServiceHost and/or AbstractServiceHostBuilder and/or WcfServiceModel
to support the feature (expose WCF service with only an interceptor to handle the requests).

Cheers,
Fr�d�ric


2010/2/8 Craig Neuwirt <cneu...@gmail.com>
Thanks,
ďż˝ I'll take a look when a get a free moment.

2010/2/8 Fr�d�ric Legrain <f.le...@gmail.com>
Here it is : just copy/paste in a Console application with the required references (see usings, i'm working with trunk of WCF Integration).

Tanks,
Fr�d�ric


--------------------------------------------

using System;
using Castle.Windsor;
using Castle.Facilities.WcfIntegration;
using Castle.MicroKernel.Registration;
using System.ServiceModel.Description;
using System.ServiceModel;
using Castle.Core.Interceptor;

namespace WcfIntegration.ConsoleDemo
{
��� class Program
��� {
��� ��� static void Main(string[] args)
��� ��� {
��� ��� ��� Scenarios.InterceptorOnly.Run();
��� ��� }
��� }
}

namespace WcfIntegration.ConsoleDemo.Scenarios
{
��� class InterceptorOnly
��� {
��� ��� public static void Run()
��� ��� {
��� ��� ��� System.Diagnostics.Debug.WriteLine("Running interceptor-only Scenario");

��� ��� ��� // SERVICE: Setup container with WCF facility
��� ��� ��� IWindsorContainer container;
��� ��� ��� container = new WindsorContainer()
��� ��� ��� ��� .AddFacility<WcfFacility>();

��� ��� ��� // SERVICE: Register WCF metadata logic
��� ��� ��� container.Register(Component
��� ��� ��� ��� .For<IServiceBehavior>()
��� ��� ��� ��� .Instance(new ServiceMetadataBehavior() { HttpGetEnabled = true })
��� ��� ��� ��� );

��� ��� ��� // SERVICE: Register interceptor
��� ��� ��� container.Register(Component.For<Misc.HelloInterceptor>());

��� ��� ��� // SERVICE: Register IHelloService with explicit implementation (HelloServiceImpl)
��� ��� ��� container.Register(Component
��� ��� ��� ��� .For(typeof(HelloService.IHelloService))
��� ��� ��� ��� .Interceptors(typeof(Misc.HelloInterceptor))
��� ��� ��� ��� // NO EXPLICIT IMPLEMENTATION .ImplementedBy<Misc.HelloServiceImpl>()
��� ��� ��� ��� .ActAs(new DefaultServiceModel()
��� ��� ��� ��� ��� .AddBaseAddresses("http://localhost:6080/HelloService/")
��� ��� ��� ��� ��� .AddEndpoints(WcfEndpoint.BoundTo(new BasicHttpBinding()))
��� ��� ��� ��� ��� )
��� ��� ��� ��� );

��� ��� ��� // SERVICE: test get service from same container
��� ��� ��� container.Resolve<HelloService.IHelloService>().Hello();


��� ��� ��� // CLIENT:
��� ��� ��� HelloService.IHelloService client;
��� ��� ��� client = ChannelFactory<HelloService.IHelloService>.CreateChannel(
��� ��� ��� ��� new BasicHttpBinding(),
��� ��� ��� ��� new EndpointAddress("http://localhost:6080/HelloService/")
��� ��� ��� ��� );
��� ��� ��� client.Hello();


��� ��� ��� // DISPOSE:
��� ��� ��� container.Dispose();
��� ��� }
��� }
}

namespace WcfIntegration.ConsoleDemo.HelloService

{
��� [ServiceContract]
��� public interface IHelloService
��� {
��� ��� [OperationContract]
��� ��� HelloReply HelloInOut(HelloMessage request);

��� ��� [OperationContract]
��� ��� void HelloIn(HelloMessage request);

��� ��� [OperationContract]
��� ��� HelloReply HelloOut();

��� ��� [OperationContract]
��� ��� void Hello();
��� }

��� public class HelloMessage
��� {
��� ��� public string HelloText;
��� ��� public DateTime HelloTime;
��� ��� public Smile[] Smiles;
��� }

��� public class Smile
��� {
��� ��� public string Description;
��� ��� public bool ShowTeeth;
��� }

��� public class HelloReply
��� {
��� ��� public string HelloResponse;
��� ��� public double SmileFactor;
��� }
}

namespace WcfIntegration.ConsoleDemo.Misc
{
��� public class HelloInterceptor : IInterceptor
��� {
��� ��� public HelloInterceptor()
��� ��� { }

��� ��� #region IInterceptor Members

��� ��� public void Intercept(IInvocation invocation)
��� ��� {
��� ��� ��� System.Diagnostics.Debug.WriteLine(string.Format("HelloInterceptor: {0} @ {1}", invocation.Method.Name, DateTime.Now.ToLongTimeString()));
��� ��� ��� // DO THE IHelloService BUSINESS
��� ��� }

��� ��� #endregion
��� }
}

--------------------------------------------


2010/2/8 Craig Neuwirt <cneu...@gmail.com>
That doesn't make sense to me.ďż˝ Are you getting an exception?ďż˝ Can you send me a test case to demonstrate?

thanks,
�craig

2010/2/8 Fr�d�ric Legrain <f.le...@gmail.com>
Right. Now resolve works using the same container. Thank you.

Yet, remote WCF calls still don't work. This looks like WCF Facility do not expose services that have no implementation.



2010/2/5 Craig Neuwirt <cneu...@gmail.com>
You need to register the HelloServiceInterceptor too.

2010/2/5 Fr�d�ric Legrain <f.le...@gmail.com>
Actually I get no error when I register.
But nothing seems to come out, service is not available...

If I try getting a service client from the same container, I get an exception:
"ComponentActivator: could not proxy HelloModule.IHelloService" > "The interceptor could not be resolved".



2010/2/5 Craig Neuwirt <cneu...@gmail.com>
What error do you get when you do this?

On Thu, Feb 4, 2010 at 9:50 AM, fredlegrain <f.le...@gmail.com> wrote:
I'd like to customize WCF Integration Facility to make capable of
exposing a service host based on a provided ServiceContract interface
and handling calls through a provided interceptor.

Let's say I have a ServiceContract interface :

ďż˝ ďż˝[ServiceContract]
� �public interface IHelloService {
ďż˝ ďż˝ ďż˝ ďż˝[OperationContract]
� � � �string SayHello(string message);
ďż˝ ďż˝}


Let's says I don't have (and don't want to have) any implementation of
IHelloService.
But I have an interceptor (let's call it HelloServiceInterceptor)
which knows how to answer the service calls.

I'd like to have my init code look like this :

� �container.Register(Component
ďż˝ ďż˝ ďż˝ ďż˝.For(typeof(IHelloService))
ďż˝ ďż˝ ďż˝ ďż˝.Interceptors(typeof(HelloServiceInterceptor)).First
ďż˝ ďż˝ ďż˝ ďż˝.ActAs(new DefaultServiceModel()
ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝.AddEndpoints(WcfEndpoint
ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝.BoundTo(new BasicHttpBinding())
ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝.At("http://localhost:6080/HelloService/")
ďż˝ ďż˝ ďż˝ ďż˝ ďż˝ ďż˝)
ďż˝ ďż˝ ďż˝ ďż˝)
ďż˝ ďż˝);


Do you expect that be feasible?
How can I customize Windsor and/or WCF Integration Facility to achieve
that?
Maybe a custom ServiceModel would allow me to do the job?

Cheers,
Fr�d�ric

Craig Neuwirt

unread,
Feb 11, 2010, 4:04:32 PM2/11/10
to castle-pro...@googlegroups.com
So what did you do to make this work?

2010/2/11 Frédéric Legrain <f.le...@gmail.com>

Frédéric Legrain

unread,
Feb 12, 2010, 3:36:15 AM2/12/10
to castle-pro...@googlegroups.com
Craig,
Based on my "Hello" example, I provide a DP of IHelloService as implementation, with HelloInterceptor to handle the requests.
But there are some limitations. One is that there is only a single instance of the DP handling the requests (but is it a real problem?)

Krzysztof,
How did you make it work?



2010/2/11 Craig Neuwirt <cneu...@gmail.com>

Krzysztof Koźmic (2)

unread,
Feb 12, 2010, 7:12:31 AM2/12/10
to Castle Project Users
I change the topic to a more specific one.
I like the name Ghost service for this feature. Other possibilities
include class-less services, or whatever you come up with.

Frédéric,

My spike code is here
http://code.assembla.com/kkozmic/subversion/nodes/Garage/WcfGHost?rev=79

Implementing this feature would enable another thing I was thinking
about (
http://castle.uservoice.com/forums/16605-official-castle-project-feedback-forum/suggestions/188895-wcf-facility-support-mixin-services?ref=title
)

Currntly in WCF when we have multiple services (classes) we need to
provide a new ServiceHost for each, which means each has its own
runtime, lots of resources are duplicated etc.

With this we could build up one big umbrella service proxy-class,
build single ServiceHost and using proxy with target interface inject
as target appropriate class (or use none and rely on interceptors or
some other mechanism) to provide implementation.
We don't really need to worry about matching lifetimes here, since we
can rely on Windsor lifectime management mechanism to do that for us.

This feels like a great feature to me (especially since I'm feeling
the pain it would alleviate, in my current project).

Am I missing something obvious here?
What do you guys think?

Krzysztof


On 12 Lut, 09:36, Frédéric Legrain <f.legr...@gmail.com> wrote:
> Craig,
> Based on my "Hello" example, I provide a DP of IHelloService as
> implementation, with HelloInterceptor to handle the requests.
> But there are some limitations. One is that there is only a single instance
> of the DP handling the requests (but is it a real problem?)
>
> Krzysztof,
> How did you make it work?
>

> 2010/2/11 Craig Neuwirt <cneuw...@gmail.com>


>
> > So what did you do to make this work?
>

> > 2010/2/11 Frédéric Legrain <f.legr...@gmail.com>


>
> >> Krzysztof,
> >> Good news you consider adding the feature to WCF Facility.
> >> I also already have a solution working with DP, just could'nt figure out
> >> if WCF Facility was already capable of it.
>
> >> Can I help on this one?
> >> I was considering providing my own customized IWcfServiceHost and/or
> >> AbstractServiceHostBuilder and/or WcfServiceModel
> >> to support the feature. Or do you consider adding this to the
> >> DefaultServiceHost/HostBuilder/Model ?
>
> >> Frédéric
>

> >> 2010/2/10 Krzysztof Koźmic <krzysztof.koz...@gmail.com>


>
> >> Frédéric, good news!
>
> >>> I was able to build a working proof-of-concept solution based on
> >>> DynamicProxy and WCF only.
> >>> We'll take a look at bringing this functionality to WCF Facility now.
>
> >>> Krzysztof
>
> >>> On 2010-02-10 20:47, Craig Neuwirt wrote:
>
> >>> Definitely a limitation. Working with Krzysztof to find the best
> >>> solution.
>
> >>> thanks,
> >>> craig
>

> >>> 2010/2/8 Frédéric Legrain <f.legr...@gmail.com>


>
> >>>> You're welcome, thanks you for your time.
> >>>> About the exception, I get it when trying to call the service (line "
> >>>> client.Hello(); " -> server actively refused connection )
>
> >>>> I am considering providing my own customized IWcfServiceHost and/or
> >>>> AbstractServiceHostBuilder and/or WcfServiceModel
> >>>> to support the feature (expose WCF service with only an interceptor to
> >>>> handle the requests).
>
> >>>> Cheers,
> >>>> Frédéric
>

> >>>> 2010/2/8 Craig Neuwirt <cneuw...@gmail.com>


>
> >>>>> Thanks,
> >>>>> I'll take a look when a get a free moment.
>

> >>>>> 2010/2/8 Frédéric Legrain <f.legr...@gmail.com>

> >>>>>> 2010/2/8 Craig Neuwirt <cneuw...@gmail.com>


>
> >>>>>>> That doesn't make sense to me. Are you getting an exception? Can
> >>>>>>> you send me a test case to demonstrate?
>
> >>>>>>> thanks,
> >>>>>>> craig
>

> >>>>>>> 2010/2/8 Frédéric Legrain <f.legr...@gmail.com>


>
> >>>>>>>> Right. Now resolve works using the same container. Thank you.
>
> >>>>>>>> Yet, remote WCF calls still don't work. This looks like WCF Facility
> >>>>>>>> do not expose services that have no implementation.
>

> >>>>>>>> 2010/2/5 Craig Neuwirt <cneuw...@gmail.com>


>
> >>>>>>>>> You need to register the HelloServiceInterceptor too.
>

> >>>>>>>>> 2010/2/5 Frédéric Legrain <f.legr...@gmail.com>


>
> >>>>>>>>>> Actually I get no error when I register.
> >>>>>>>>>> But nothing seems to come out, service is not available...
>
> >>>>>>>>>> If I try getting a service client from the same container, I get
> >>>>>>>>>> an exception:
> >>>>>>>>>> "ComponentActivator: could not proxy HelloModule.IHelloService" >
> >>>>>>>>>> "The interceptor could not be resolved".
>

> >>>>>>>>>> 2010/2/5 Craig Neuwirt <cneuw...@gmail.com>

> ...
>
> więcej >>

Frédéric Legrain

unread,
Feb 16, 2010, 4:26:52 AM2/16/10
to castle-pro...@googlegroups.com
Krzysztof,
I have the same Behavior/InstanceProvider mechanism (but at endpoint level).
About supporting mixin services, this sounds great.



2010/2/12 Krzysztof Koźmic (2) <krzy...@kozmic.pl>

--

Craig Neuwirt

unread,
Dec 9, 2012, 9:01:00 AM12/9/12
to castle-pro...@googlegroups.com
I can't remember either.  You could always give it a try and see if it works.

Sent from my iPhone

On Dec 8, 2012, at 7:26 AM, Nicolás Sabena <nsa...@gmail.com> wrote:

I'm sorry to revive such an old post, but the posibilities mentioned here about providing an "implementation" of services based only on interceptors sound great.
 
Did you ever make this work? Was it included in the Wcf Facility?
--
You received this message because you are subscribed to the Google Groups "Castle Project Users" group.

Nicolás Sabena

unread,
Dec 9, 2012, 12:05:12 PM12/9/12
to castle-pro...@googlegroups.com
Sorry I wasn't more specific: i did try with no luck.
First I get an error from the facility about proxy targets, that I fixed doing this after registration of the service:
 
            var model = container.Kernel.GetHandler(typeof(TComponent)).ComponentModel;
            var proxyOptions = Castle.MicroKernel.Proxy.ProxyOptionsUtil.ObtainProxyOptions(model, true);
            proxyOptions.OmitTarget = true;
 
(Note: i'm trying again now and it seems that the "OmitTarge = true" is no longer neccesary, this was probably fixed between v3.0 and v3.1).
 
But, anyway, I hit a wall after that, getting this error when I'm trying to run the host (accesing the .svc):
 
 
[ArgumentException: ServiceHost only supports class service types.]
   System.ServiceModel.Description.ServiceDescription.GetService(Type serviceType) +12904571
   System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts) +58
   System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +146
   System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +46
   System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +146
   Castle.Facilities.WcfIntegration.DefaultServiceHostBuilder.CreateServiceHost(ComponentModel model, Uri[] baseAddresses) +39
That's why I was curious if somebod else got this working...
Reply all
Reply to author
Forward
0 new messages