我们正在使用WCF服务关闭WCF连接
在客户端,我们正计划明确地关闭连接 似乎有关闭
样本1的多,其中一个方法: 在finally块WCF服务消费使用
if (client.State == CommunicationState.Faulted)
{
client.Abort();
}
client.Close();
,因为如果服务处于故障状态,我们将无法调用close()
样品2:
using(ClientProxy proxy = new ClientProxy())
{
//call your service methods
}
在SAMPLE2我不知道,如果服务处于故障状态会发生什么,它会抛出错误关闭连接?
@ Balaji-看看这后http://stackoverflow.com/questions/573872/what-is-the-best-workaround- for-the-wcf-client-using-block-issue。这是最有帮助的 – RichardOD 2009-09-18 10:11:48