Custom MembershipProvider calling web service


V

Vincent Finn

Hi,

I have written a MembershipProvider that calls a WCF webservice.

It works fine but I am wondering about the creation of the
ServiceClient objects.

The examples I have seen of calling a WCF webservice all follow this
pattern

MyServiceClient client = new MyServiceClient();
client.Method();

That is what I am doing but I was wondering about the expense of
creating all the MyServiceClient objects.

The Provider is not recreated for every function call so i can create
the MyServiceClient instance in the constructor and use it.

This seems the more obvious way of doing things to me but I wanted to
check if there are object lifetime issues with it or anything other
reason to create everytime?

Any advice appreciated.

Thanks, Vincent
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top