tags:

views:

233

answers:

2

I have a misconception about WCF services (I think) Can you have just one instance of the WCF service that all calls would go too? It seems I am limited to having to create instances of WCF class every time I need to call it. If I can, do I have to make it static somehow?

+1  A: 

what you wanna do is to making wcf services singleton check this article , ull find it helpful

Adinochestva
Thanks for the info.
Matt
+1  A: 

On the server-side, yes, an instance of your service is created for every request / transaction.

On the client-side, you should almost never try to reuse your proxy class. Instantiate, connect, call (you can even call multiple times in a loop), dispose.

Randolpho
Interesting. This has been my approach but more due to trial and error than an understanding of the connection pool internals. Can you elaborate on why this works and why "you should almost never try to reuse"?
grenade