Its a well know fact that webservices are stateless. Its writ开发者_C百科ten 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.
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.
精彩评论