This project is read-only.

Correct use in ASP.NET/WCF service

Mar 23, 2009 at 3:26 AM

A quick question, what is the proper way to use an endpoint in WCF service? 

The endpoint is used for send and request/response from within a WCF service.  So the question is do I create a single instance and share it between all requests, and if so do I need any locking or is it thread safe? 

Cheers,

Stephen.
Mar 23, 2009 at 5:06 PM
SSB endpoints are designed to be used in a multi-threaded environment, so you shouldn't need to do any explicit locking, so one endpoint per service instance (not per call) would be the way to go. We host our WCF services and our endpoints in a windows service so we can maintain complete control over the lifespan of the host process, but this isn't a requirement by any means.