Try OpenEdge Now
skip to main content
Web Services
Understanding WSDL Details : Defining DATASET (static ProDataSet) parameters : Including before-image data
 

Including before-image data

Before-image data is serialized in a proprietary OpenEdge datasetChanges document. The WSDL represents the parameter as arbitrary complex data with an <any> element. XML Schema attributes from the ABL-specific namespace identify the element as a datasetChanges document.
An ABL-based client can map the <any> element to a ProDataSet parameter and parse the OpenEdge datasetChanges document into a ProDataSet and its before-image data through the READ-XML( ) method. For more information on how ABL handles before-image data in XML, see the chapter on reading and writing XML data from ProDataSets in OpenEdge Development: Working with XML. Non-ABL clients map the <any> element to an XML document that the client developer needs to parse with an XML API.
The following code snippet defines a ProDataSet with before-image data:
/* getCustOrdersBI.p */
DEFINE TEMP-TABLE    ttCust     NO-UNDO
       BEFORE-TABLE  ttCustBef
       FIELD         CustNum    AS INTEGER
       FIELD         Name       AS CHARACTER
       INDEX         CustNumIdx IS UNIQUE PRIMARY CustNum.

DEFINE TEMP-TABLE   ttOrder     NO-UNDO
       BEFORE-TABLE ttOrderBef
       FIELD        OrderNum    AS INTEGER
       FIELD        CustNum     AS INTEGER
       INDEX        OrderNumIdx IS UNIQUE PRIMARY OrderNum
       INDEX        CustOrdIdx  IS UNIQUE CustNum OrderNum.

DEFINE DATASET dsCustOrd FOR ttCust, ttOrder
       DATA-RELATION CustOrdRel FOR ttCust, ttOrder
         RELATION-FIELDS (CustNum, CustNum).

DEFINE INPUT  PARAMETER iCustNum AS INTEGER.
DEFINE OUTPUT PARAMETER DATASET  FOR dsCustOrd.

/* fill dataset and return to caller */
...
The following WSDL sample defines the ProDataSet parameter for getCustOrdersBI.p using the Doc/Lit SOAP format:

Doc/Lit WSDL for getCustOrdersBI.p

<!-- datasetChanges document -->
<complexType name="dsCustOrdChanges"
  prodata:datasetName="dsCustOrd"
  prodata:isDsChanges="true"
  prodata:namespace="WebServiceNameSpace:ObjectName">
  <sequence>
    <any />
  </sequence>
</complexType>
<!-- dataset definition -->
<element name="dsCustOrd" prodata:proDataSet="true">
  <complexType>
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="ttCust"
               prodata:beforeTable="BIttCust">
        <complexType>
          <sequence>
            <element name="CustNum" nillable="true" type="xsd:int"/>
            <element name="Name" nillable="true" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element maxOccurs="unbounded" minOccurs="0" name="ttOrder"
               prodata:beforeTable="BIttOrder">
        <complexType>
          <sequence>
            <element name="OrderNum" nillable="true" type="xsd:int"/>
            <element name="CustNum" nillable="true" type="xsd:int"/>
          </sequence>
        </complexType>
      </element>
    </sequence>
  </complexType>
</element>
Note: ObjectName refers to the object's name as defined in ProxyGen. Each object gets its own XML Schema.
Note that the ProDataSet parameter is described in two parts:
*An arbitrary complex type (<any />) for the OpenEdge datasetChanges document
*The ProDataSet definition specifying the before-image tables with the prodata:beforeTable attribute
The RPC styles use the same structure for the dataset definition.