Do I need to dispose a web service reference in ASP.NET? Can I use a singleton?
Do I really need to dispose a SoapHttpClientProtocol
object?
Is it better practice to use the instance as a Singleton
in ASP.Net?
This says that SoapHttpClientProtocol
is Thread Safe:
The fact that it is thread-safe means that using it as singleton will reduce your site almost to a single-threaded application.
Proxies - especially for a web application - should always be created as temporary object inside a using
block (although in WCF it needs to be a different approach). This approach will have its overhead of creating a proxy every time but is the safest approach. This will prevent different clients of the ASP.NET application clashing with each other or using a closed or faulted proxy.
精彩评论