Step 1: Declare a W3CEndpointReference record to be used as state variable

This record MUST have:

For example:
DEFINE EndpointReferenceState RECORD ATTRIBUTES(W3CEndpointReference)
  address STRING, # Mandatory
  ref RECORD # Sub-record Reference parameters containing one 
             # or more state variables
    OpaqueID STRING ATTRIBUTES(XMLName="OpaqueID"), # Unique ID to
               #identify the service state in the database
    Expiration DATE ATTRIBUTES(XMLName="Expiration",
      XMLNamespace="http://tempuri.org") # Session state expiration date
  END RECORD
END RECORD

You can use a unique ID of a database table to manage the web services sessions in place of OpaqueID.