How Do I: Design a Web Service that Involves Long-Running Operations?
WebLogic Workshop introduces the notion of conversations to manage the state of your web service (stored in class member variables) over a long-running sequence of operations and correlate messages between your web service and its clients and controls. To use conversations, you simply set the conversation property on each method or callback, marking it as starting, continuing, or finishing a conversation. When a start method is called, WebLogic Server creates a new record (a conversation instance) for the state of the web service. When continue methods or callbacks are called, the state of the conversation is accessible. After a finish method or callback completes, the conversation state is deleted to release server resources.
To Specify the Conversational Behavior of a Web Service
In Design View, select a method you wish to start a conversation.
In the Properties pane, expand the conversation property.
On the phase attribute, from the drop-down list, select start.
Repeat steps 1 through 3 for each method that can start a conversation.
Select a method you wish to continue the conversation.
In the Properties pane, expand the conversation property.
On the phase attribute, from the drop-down list, select continue.
Repeat from steps 5 through 7 for each method that can continue a conversation.
Select a method you wish to finish the conversation.
In the Properties pane, expand the conversation property.
On the phase attribute, from the drop-down list, select finish.
Repeat steps 9 through 11 for each method that can finish a conversation.
To Specify Conversation Lifetime
Conversations represent server resources and should be released whenever possible. In addition to marking methods of a conversation to control how they affect conversation phase, you can also configure the maximum lifetime or idle time of a conversation. These properties will cause the conversation to be released after a specified period even if (or because) none of the conversational methods have been called.
To set the maximum lifetime of a conversation, regardless of whether or when continue or finish methods are called, set the max-age attribute of the conversation-lifetime property on the web service.
To set the maximum idle time of a conversation (the maximum time that may pass between method invocations), set the max-idle-time attribute of the conversation-lifetime property on the web service.