views:

72

answers:

1

Its a well know fact that webservices are stateless. Its written in every text that deals with WCF basics. But I need to know, Are they truely stateless.

I was reading about the PerCall WCF webservice, which destroy the service instance for every call. I am not able to comprehend the use of Percall service. If webservices are stateless, then what is the need of destroying service instance for each call.

+3  A: 

WCF has several instance models.

  • Single (Singleton) , where 1 instance handles all requests.
  • PerCall model where each call gets a separate instance
  • PerSession model where each client gets an instance (statefull)

The PerCall model is truly stateless. With the singleton model it depends on how you write it (but stateless is strongly advised). The PerSession model is not stateless at all.

There are trade-offs regarding memory use, concurrency, latency and security.

Henk Holterman