tags:

views:

188

answers:

1

I have WCF service client implemented using asynchronous event(using /async and /tcv:Version35 in svcutil).

I wanted to know the best way to manage service client.

As of now, I am creating a new service client on each request and closing the service client when the event delegate returns. Is it a good practice to create new service client on each request. If I try to use the same service client then I have to de-register the event handlers to every request once the request is furnished which somehow does not look like an elegant way to achieve this.

Any pointers ?

Thanks Amit

+1  A: 

if your services are stateless/sessionless then it's a good practice to create a service request and close/dispose them after use.

see this link on how to properly dispose a WCF service client

cruizer