我一直在使用Castle Windsor的WCF服务,我可以在设置容器之后注册:
IWindsorContainer container = new WindsorContainer();
container.AddFacility<WcfFacility>().Register(
Component.For<IActivityLogsRepository>().ImplementedBy<ActivityLogsRepository>(),
Component.For<IActivityLogsService>().ImplementedBy<ActivityLogsService>()
.Named("Company.ServiceImplementation.ActivityLogsService"),
但我的问题始于使用CallbackContract,如此处所述 http://msdn.microsoft.com/en-us/library/ms752254(v=vs.100).aspx
从Castle文档中我发现了这一点 http://docs.castleproject.org/Windsor.WCF-Facility-Lifestyles.ashx
我做了类似的事
Component.For<ISampleService>().ImplementedBy<SampleService>()
.LifeStyle.PerWcfSession(),
我的服务器配置文件是
<bindings>
<basicHttpBinding>
<binding name="LargeHttpBinding" closeTimeout="00:10:00" openTimeout="00:10:00"
sendTimeout="00:10:00" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="LargeNetTcpBinding" maxBufferPoolSize="5242880"
maxBufferSize="5242880" maxReceivedMessageSize="5242880" />
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="LargeBehavior" name="MyCompany.ServiceImplementation.SampleService"><endpoint address="net.tcp://localhost:808/MyCompany.WcfServices/SampleService.svc" binding="netTcpBinding" bindingConfiguration="LargeNetTcpBinding"
name="netTcp" contract="MyCompany.ServiceContract.ISampleService" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
name="Mex" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:808/MyCompany.WcfServices/" />
</baseAddresses>
</host>
有人知道是否可以使用Callbacks设置Castle Windsor Facility,如果可以的话,如何实现它
谢谢
答案 0 :(得分:1)
我不认为(99%肯定)目前支持这个。