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

This record MUST have:

For example:
DEFINE EndpointReferenceState RECORD ATTRIBUTE(W3CEndpointReference)
  address STRING, # Mandatory
  ref RECORD # Sub-record Reference parameters containing one 
             # or more state variables
    OpaqueID STRING ATTRIBUTE(XMLName="OpaqueID"), # Unique ID to
               #identify the service state in the database
    Expiration DATE ATTRIBUTE(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.