Craig,
So, do you still need to register the services in web.config? If not,
can you give a Binsor-ish example of registering a service, complete
with serviceBehaviors, endpointBehaviors, multiple endpoints, etc.
(I am sorry if this is readily obvious from what you have already
written.)
Thanks,
Glenn
On Mar 24, 12:54 pm, "Craig Neuwirt" <
cneuw...@gmail.com> wrote:
> I'm honored :-)
>
> On Mon, Mar 24, 2008 at 10:42 AM, Ayende Rahien <
aye...@ayende.com> wrote:
> > Craig,
> > You just won the first hostile blogging award.
> > This is just too good to leave on the mailing list.
>
> > On Mon, Mar 24, 2008 at 5:29 PM, Craig Neuwirt <
cneuw...@gmail.com> wrote:
>
> > > I have just committed some updates to the WCF Integration Facility to
> > > add consistent and transparent support for both clients and services.
>
> > > Here is a summary of the features
>
> > > - *Client Side
> > > *
> > > - *Automatic generation of WCF client channels when a
> > > component has been configured for WCF Client capabilities.*
>
> > > new WindsorContainer().Register( Component.For<IOperations>()
> > > .CustomDependencies(new
> > > {
> > > clientModel = new WcfClientModel()
> > > {
> > > Endpoint = WcfEndpoint
> > > .BoundTo(new NetTcpBinding())
> > > .At("net
> > > .tcp://localhost/Operations")
> > > }
> > > })
> > > );
>
> > > IOperations client = windsorContainer.Resolve
> > > <IOperations>();
>
> > > - *Any Endpoint, or Operation behaviors registered in the kernel
> > > will be attached to the channels.*
>
> > > new WindsorContainer().Register(
> > > Component.For
> > > <IOperationBehavior>().ImplementedBy<NetDataContractFormatBehavior>()
> > > );
>
> > > - *Automatic cleanup of channel proxy when component is released (
> > > channel.Close() vs channel.Abort)*
> > > - No need to cast proxy to IChannel and call Dispose
>
> > > - *Automatic detection of unhanded channel faults and
> > > re-acquisition of new channel proxy*
> > > - You can continue to use client proxy even after an
> > > exception occurs. By default WCF makes all faulted channels unavailable
>
> > > - *Ability to use the client channel configuration from App.Config/Web.Config
> > > (if you really must!!)*
>
> > > new WindsorContainer().Register( Component.For
> > > <IAmUsingWindsor>()
> > > .CustomDependencies(new
> > > {
> > > clientModel = new WcfClientModel()
> > > {
> > > Endpoint = WcfEndpoint
>
> > > .FromConfiguration("WSHttpBinding_IAmUsingWindsor")
> > > }
> > > }));
>
> > > - *Custom Registration Provider to simplify batch registration of
> > > channels*
>
> > > new WindsorContainer()
> > > .AddFacility<WcfFacility>()
> > > .Register(WcfClient.ForChannels(
> > > new WcfClientModel()
> > > {
> > > Endpoint = WcfEndpoint.ForContract
> > > <IOperations>()
> > > .BoundTo(new NetTcpBinding())
> > > .At("net.tcp://localhost/Operations")
> > > },
> > > new WcfClientModel()
> > > {
> > > Endpoint = WcfEndpoint.ForContract
> > > <IAmUsingWindsor>()
> > > .BoundTo(new BasicHttpBinding())
> > > .At("
http://localhost:27198/UsingWindsor.svc
> > > ")
> > > }))
>
> > > - *Support for Xml Configuration (if you still use it)*
>
> > > <component id="usingWindsor"
> > > type="
> > > Castle.Facilities.WcfIntegration.Demo.IAmUsingWindsor,
> > > Castle.Facilities.WcfIntegration.Demo"
> > > *
> > > wcfEndpointConfiguration="WSHttpBinding_IAmUsingWindsor"*>
> > > </component>
>
> > > - *Client extensibility interface IClientChannelBuilder*
> > > - Supports plugging in other ways to create channels (
> > > e.g. RESTful services)
>
> > > - Service Side
> > > - *Automatic management of ServiceHost when a component is
> > > configured for WCF Service capabilities*
>
> > > new WindsorContainer()
> > > .AddFacility<WcfFacility>()
> > > .Register( Component.For
> > > <IOperations>().ImplementedBy<Operations>()
> > > .CustomDependencies(new
> > > {
> > > number = 42,
> > > serviceModel = new WcfServiceModel()
> > > .AddEndpoints(
> > > WcfEndpoint.BoundTo(new NetTcpBinding())
> > > .At("net
> > > .tcp://localhost/Operations")
> > > )
> > > })
> > > )
>
> > > - *Any Service, Endpoint, or Operation behaviors registered in the
> > > kernel will be attached to the channels.*
>
> > > new WindsorContainer()
> > > .Register(
> > > Component.For<LoggingInterceptor>(),
> > > Component.For
> > > <IServiceBehavior>().ImplementedBy<CallCountServiceBehavior>(),
> > > Component.For
> > > <IEndpointBehavior>().ImplementedBy<UnitOfworkEndPointBehavior>(),
> > > Component.For
> > > <IOperationBehavior>().ImplementedBy<NetDataContractFormatBehavior>()
> > > );
>
> > > - *Ability to use the service channel configuration from
> > > App.Config/Web.Config (if you really must!!)*
>
> > > new WindsorContainer()
> > > .AddFacility<WcfFacility>()
> > > .Register(Component.For<UsingWindsor>()
> > > .CustomDependencies(new
> > > {
> > > number = 42,
> > > serviceModel = new WcfServiceModel()
> > > })
> > > )
>
> > > - *Support for Xml Configuration (if you still use it)*
>
> > > <component id="usingwindsor_svc"
> > > service="
> > > Castle.Facilities.WcfIntegration.Demo.IAmUsingWindsor,
> > > Castle.Facilities.WcfIntegration.Demo"
> > > type="
> > > Castle.Facilities.WcfIntegration.Demo.UsingWindsor,
> > > Castle.Facilities.WcfIntegration.Demo"
> > > *wcfServiceHost="true"*>
> > > <parameters>
> > > <number>42</number>
> > > </parameters>
> > > </component>
>
> > > - *Supports endpoints with relative addressing*
>
> > > new WindsorContainer()
> > > .AddFacility<WcfFacility>()
> > > .Register( Component.For<Operations>()
> > > .CustomDependencies(new
> > > {
> > > number = 42,
> > > serviceModel = new WcfServiceModel()
> > > .AddBaseAddresses(
> > > "net.tcp://localhost/Operations",
> > > "
http://localhost:27198/UsingWindsor.svc
> > > ")
> > > .AddEndpoints(
> > > WcfEndpoint.ForContract<IOperations>()
> > > .BoundTo(new NetTcpBinding()),
> > > WcfEndpoint.ForContract<IOperationsEx>()
> > > .BoundTo(new BasicHttpBinding())
> > > .At("Extended")
> > > )
> > > })
> > > );
>
> > > - *Automatic initialization of the WindsorServiceHostFactory for
> > > web apps*
> > > - No need to call WindsorServiceHostFactory(kernel) in
> > > Global asax anymore.
>
> > > - *Service extensibility interface IServiceHostBuilder*
> > > - Support plugging in other ways to create
> > > ServiceHosts.
>
> > > Craig