What is best practice when instantiating a web service

Posted by chrystad on Stack Overflow See other posts from Stack Overflow or by chrystad
Published on 2010-03-06T14:48:18Z Indexed on 2010/03/16 7:16 UTC
Read the original article Hit count: 422

Filed under:
|
|

I have a class library (c#) with many methods that call the same web service (asmx).

What is the best practice for instantiating the web service.

  • Instantiate the web service once and pass it as a parameter to each method
  • Or instantiate and dispose the web service in each method.

© Stack Overflow or respective owner

Related posts about c#

Related posts about web-services