---
title: "c# how to manage wcf service proxy lifecycle on client side?"  
description: "c# how to manage wcf service proxy lifecycle on client side?"  
author: "Anonymous User"  
published: 2013-09-24  
updated: 2013-09-24  
canonical: https://www.mindstick.com/forum/1506/c-sharp-how-to-manage-wcf-service-proxy-lifecycle-on-client-side  
category: "c#"  
tags: ["c#", "mindstick", "wcf service", "proxy lifecycle", "proxy lifecycle on client side", "manage wcf service proxy lifecycle"]  
reading_time: 2 minutes  

---

# c# how to manage wcf service proxy lifecycle on client side?

I have written a WCF [service](https://www.mindstick.com/articles/105963/online-thesis-writing-service-for-college-kids-with-disabilities) with some regular [functionality](https://www.mindstick.com/blog/136/using-watermark-functionality-in-textbox-by-jquery) (add user, remove, search, update...). The [implementation](https://www.mindstick.com/forum/33764/how-to-implementation-of-class-in-c-sharp) of this functionality is in [entity framework](https://www.mindstick.com/articles/1566/crud-operations-using-entity-framework-code-first-approach) (with sql DB).

Now I want to use it in the [client side](https://www.mindstick.com/forum/160418/what-are-the-best-practices-for-securely-storing-bearer-tokens-on-the-client-side). And I have some basic [questions](https://www.mindstick.com/blog/124895/hp-hpe0-s54-cheat-sheet-exam-questions-bank-for-guaranteed-success):

I have many calls to the WCF [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) in the client side - should I try catch every time each call?

Every time I want to call a method, for example AddUser(User user), I need to make an [instance](https://www.mindstick.com/forum/155658/testing-connection-to-cloud-sql-instance-with-a-mysql-client-from-vm-instance) of my service, like that:

WcfService client = new WcfService();

client.AddUser(user);

And in another place I write:

WcfService client = new WcfService(); //Again making a new instance...

client.UpdateUser(user);

Should I make one instance for all the [application](https://www.mindstick.com/articles/12824/calculator-application-in-android) for my wcf service? Or every time to make a new instance before I call to a method? (as in my example above).

Thanks very much !

## Replies

### Reply by Pravesh Singh

Hi Goti,

(i)You can make an instance one time for a service, and use the same client whenever you need to make a method call. If you are aborting or closing the connection then you need to create each time.

(ii)It is better if you use try catch methods in each methods, so it will be easy to close the connection and identify the exceptions.


---

Original Source: https://www.mindstick.com/forum/1506/c-sharp-how-to-manage-wcf-service-proxy-lifecycle-on-client-side

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
