I would like some clarity around the following (apologies in advance if this is a stupid question)
Am working on some existing code which calls a WCF service.
This code instantiates a WCF service client via an interface and performs the operations it needs i.e.:
IWCFService proxyClient = new WCFServiceClient()
However what am trying to do here is ensure the connection is closed gracefully i.e.: proxyClient.Close()
etc but I cant access these seeing as its created via an interface (which just houses the operations i.e.: DoSomething()
)
If i instantiate as a WCF service client (and not via interface) i will be able to access the Close() & Abort calls which i can use in try{}catch{} blocks. i.e.:
WCFServiceClient proxyClient = new WCFServiceClient()
//do some stuff..
proxyClient.Close()
Is it a simple case of adding Close() & Abort() to the interface definition and then calling these in the code which should in turn implement the WCF implementations of these?