Yes, each request generates a new instance of your web service class.
However, you can use static constructors that will initialize some static fields. Please note that these fields will be distributed to all users and all requests of your web service.
public class WebService1 : System.Web.Services.WebService { public static int loadedFromDataBase; static WebService1() { loadedFromDataBase = ... } [WebMethod] public string HelloWorld() { return loadedFromDataBase.ToString(); } }
Sweko source share