开发者

Wcf Service PerCall WcfFacility

开发者 https://www.devze.com 2023-02-18 20:09 出处:网络
how can i get the WcfFacility to make my service Per call, I have tried Component.For<IService1>().ImplementedBy<Service1>().AsWcfService(new DefaultServiceModel()).LifeStyle.PerWcfOperat

how can i get the WcfFacility to make my service Per call, I have tried

Component.For<IService1>().ImplementedBy<Service1>().AsWcfService(new DefaultServiceModel()).LifeStyle.PerWcfOperation()

however when I run the WCF Test client with out the "create new proxy" box ticked it does not run the ctor everytime.

please help

bones

开发者_运维问答(ps this is not same issue as the other post of mine, that is still an issue too)


Shiraz pointed out a way which I was aware of however knowning castle does lifeStyle management of PerCall and PerSession, i was hoping for a way which did not include the default attributes.

I recently changed the line of code in the question to

Component.For<IService1>().ImplementedBy<Service1>().ActAs(new DefaultServiceModel().Hosted()).LifeStyle.PerWcfOperation()

which resulted in a PerCall (on my machine). Would be very interested if this was the intended behaviour


Have you specified percall at the service definition:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] 
class MyService : IMyContract {...}
0

精彩评论

暂无评论...
验证码 换一张
取 消