State management in C++ Web services

Here is how to maintain state in managed C++ Web services.

Here is how to maintain state in managed C++ Web services.
Declare a Web method as follows:
[System::Web::Services::WebMethod (EnableSession = true)]
bool SomeFunctionToSetValue(String *someString);
To set the state in an implementation of the above function, use:
get_Session()->set_Item("SomeTag",someString);
Then, to retrieve the value in some other function, use:
String *str = get_Session()->get_Item("SomeTag");
This was first published in June 2003
This Content Component encountered an error

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close