Web Services State Management using Application Object

XML Web services can use Application object for man

DevPro Staff

November 16, 2004

2 Min Read
ITPro Today logo in a gray background | ITPro Today

XML Web services can use Application object for managing the state. Application object can be used as a shared container for state management. Application object will allow us to store the variables or object references that are available to all the visitors to the XML Web service for the life time of the web service. Application object is “in-process” which implies that it can run in the same process as ASP.NET.

 

Check the code Sample now before proceeding...

 

One difference to be noted between Session and Application  is Application object does not require the EnableSessionProperty to be set in the webmethod attribute. Let us examine the code now. We do not set the  EnableSessionProperty = True as we did in Session object. Because Any class deriving from the Web service will  have automatic access to the application object.

 

Another difference is we lock the Application to avoid concurrency issues. But this has a potential disadvantage  of slowing up the Web service. Once we lock the application we block the other users to use the same object.

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like