Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Web Service Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

18.3 Manipulating a Service's Session Data

You can modify the session data in the rwsf::CallInfo object at any point along the message handler chain. Typically, these modifications would be made in the server implementation, but you could also create a message handler specifically for manipulating the session data. For information on creating a message handler, see Chapter 14, "SOAP Message Handler SDK."

The code below shows how you might modify the session data in the rwsf::CallInfo object.

//1Retrieve the rwsf::Attribute containing the rwsf::HttpSession.
//2Create a rwsf::HttpSession object.
//3Shift the contents of httpSession into the rwsf::HttpSession object.
//4Retrieve the session ID. Use the session ID as the basis for session-specific processing.
//5Create a data object called priority.
//6Create a rwsf::Attribute instance for the priority attribute.
//7Shift the priority value into priorityAttr.
//8Add the attribute to the rwsf::HttpSession object.

This is all you need to do. The rwsf::HttpSession object passed around in the rwsf::CallInfo object is a handle to a body representing the session data held in the HydraExpress Agent. By making calls on the handle, you are directly changing the session data that will be returned to the client.

Note that rwsf::CallInfo has an interface that allows you to add and modify SOAP and transport header elements. This general-purpose mechanism for passing metadata between client and server is an alternative way to exchange session data. For more information, see Chapter 15, "SOAP and Transport Headers."



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.