Here is how to maintain state in managed C++ Web services.
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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:
Then, to retrieve the value in some other function, use:
String *str = get_Session()->get_Item("SomeTag");