Take a look here:
http://www.castleproject.org/container/facilities/trunk/wcf/index.html
http://ayende.com/Blog/archive/2007/06/12/WCF-Windsor-Integration.aspx
Note that the Castle documentation is lightly out of date and your .svc file
should look like this:
<%@ ServiceHost Language="C#" Debug="true" Service="MyService"
Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory,
Castle.Facilities.WcfIntegration" %>
"DefaultServiceHostFactory" (as per above) instead of
"WindsorServiceHostFactory" (as per docs)
"MyService" must be named in your WCF config.
Note you can also wire up Castle to proxy the clients by doing something
like this:
<castle>
<facilities>
<facility
id="wcf"
type="Castle.Facilities.WcfIntegration.WcfFacility,
Castle.Facilities.WcfIntegration" />
</facilities>
<components>
<component
id="MyServiceClient"
type="MyAssembly.MyServiceClient, MyAssembly"
wcfEndpointConfiguration="MyServiceClient"
lifestyle="transient" />
</components>
</castle>
"MyServiceClient" must be your endpoint name in your WCF config.
That way you don't need to implement any proxies your self.
Regards,
Callum
On Wed, May 6, 2009 at 9:54 AM, AndyKnight <[email protected]>wrote:
>
> Hi all,
> Im trying to find a way of using windsor with my webservice and
> wondered if anyone can help me or point me in the right direction?
> My problem is, how exactly does a webservice class get instantiated
> when there's an incoming request, and how do I override that to use
> the class from the windsor container instead?
>
> Right now, my web service contains lots of references to my static
> windsor container, like: Ioc.Resolve<IAccountService>, which makes
> unit testing the webservice class very hard.
>
>
> kind regards
>
> Andy
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---