c# - WCF 4 close client proxy -


in old days (.net framework 3.5) need careful close wcf client proxies.

in wcf 4 close not available client. available inside proxy.

public class serviceproxy : system.servicemodel.clientbase<iservice>, iloginservice { } 

is closing client proxy no longer required? or how it?

wcf proxy need closed explicitly , if using using() statement, have possibility of loosing original exception. can find details issue in following posts.

from: http://geekswithblogs.net/sudheersblog/archive/2009/09/01/134430.aspx

http://social.msdn.microsoft.com/forums/en-us/wcf/thread/b95b91c7-d498-446c-b38f-ef132989c154 http://geekswithblogs.net/marcel/archive/2007/05/01/112159.aspx

it recommended best practice close proxy when client done using it, because closing proxy terminates session service , closes connection.

alternatively, can use dispose() method of proxy close it. advantage of dispose() method can use using statement call in face of exceptions

check

http://geekswithblogs.net/softwaredoneright/archive/2008/05/23/clean-up-wcf-clients--the-right-way.aspx

http://geekswithblogs.net/bcaraway/archive/2008/07/06/123622.aspx


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -