I am asking for some advice (so sorry if this has been asked before):
When I call WCF services I use the following pattern. I developed this pattern way back with early WCF releases (in VS2008) and am curious now if this Close()/Abort() pattern is still necessary in the current version of WCF (in VS2010). It certainly does work.
I have looked into this and I see many examples calling WCF clients without this pattern, but I also know that many samples on the Internet are inferior. But is it overkill? What's the ideal pattern?
If you do have the answer, it is very important to me that you provide some type of reference so I can research into your suggestion.
var _Client = new MyServiceReference.MyServiceClient();
try
{
var _Item = _Client.GetItem(123);
_Client.Close();
return _Item;
}
catch
{
_Client.Abort();
throw;
}