0

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)

dbones
  • 4,415
  • 3
  • 36
  • 52

2 Answers2

1

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

Community
  • 1
  • 1
dbones
  • 4,415
  • 3
  • 36
  • 52
0

Have you specified percall at the service definition:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] 
class MyService : IMyContract {...}
Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • this does work however I was looking for another way without the default service behaviour. – dbones Mar 23 '11 at 00:09