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

This record MUST have:

  • A mandatory member of type STRING, where you can define a different service end point URL, otherwise the current server URL will be used.

  • A sub record to contain one or more BDL variables used as state variables and defined as reference parameter in the WS-Addressing 1.0 specification.

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.