开发者

Disposal of WCF clients where soap faults are routinely used

开发者 https://www.devze.com 2023-01-31 11:41 出处:网络
I have been looking at the thorny issue of WCF client disposal recently. One common solution I have seen is along the lines of:

I have been looking at the thorny issue of WCF client disposal recently. One common solution I have seen is along the lines of:

try
{
    client.Call();
    client.Close();
    success = true;
}
finally
{
    if(!success) client.Abort();
}

This method however will abort where a soap:fault is returned by the service, even though the service has operated correctly.

If faults are returned routinely, will large numbers of a开发者_高级运维borts cause a problem to the running of my system?


Aborts will not cause you any problems. What would cause problems is connections left open in a faulted state.

See also: Reuse a client class in WCF after it is faulted and service.close() vs. service.abort() - WCF example

0

精彩评论

暂无评论...
验证码 换一张
取 消