Hi,
I have the following code for recreating a WCf client in a non opened state
if (client.State != CommunicationState.Opened)
{
client.Abort();
client = null;
Trace.WriteLine("Client object in non opened state. Recreating object");
client = new <WCFClient>("NetTcpBindingEndpoint", ConfigurationManager.AppSettings["ServiceEndPointAddress"]);
client.Open();
}
For some reason though, as soon as this routine returns and I try to call client.Somemethod()
, I get an exception and when I catch it, I see the client in a faulted state. I don't understand how this happened so quickly.
Thanks for any help in advance.
Subbu