Using ChannelFactory Vs. Proxies in WCF?

Topics: General Discussion Forum, July and December Releases Forum, Service Factory Modeling Edition Forum
Apr 4, 2008 at 11:20 AM
Edited Apr 4, 2008 at 11:21 AM
My main reason for asking this question is that I've got a bit confused over which approach to use. It started when I realized that my proxy (autogenerated from "Add Service reference" in Visual Studio 2008) often ended up in faulted state. This happens when the proxy is not used for some time, a timeout. But it could also end in faulted state if an unhandled exception was thrown.

Can this be handled more gracefully with ChannelFactory? But if I'm to use the factory approach then I'll have to share DLL? Thats not very service-oriented, right? A SOA tenant says something like "Share schema/contract not class/code/types". But I'm not working in a SOA oriented project so I can live with this principle being overlooked.

What is best practice when it comes to WCF and handling long lived sessions between client and service?