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

Defining DATASET (static ProDataSet) parameters

DATASET parameters pass data only because the static ProDataSet's schema is known at WSDL generation. OpenEdge Web services map a DATASET definition to a <complexType> consisting of a <sequence> of elements that represent the ProDataSet's temp-tables. Each temp-table element includes a <complexType> describing the temp-table's fields. The definition also includes elements describing the data relations and indexes.
By default, a ProDataSet parameter includes only the current data. You must specify in ProxyGen the ProDataSet parameters for which you want to include before-image data. A ProDataSet parameter with before-image data is serialized as a proprietary OpenEdge datasetChanges document.
Nested and non-nested data relations produce different WSDL structures. For non-nested data relations, each temp-table description is separate. For nested data relations, the description of the child temp-table is embedded in the description of the parent temp-table.
Client-development toolkits typically define an object for every <complexType> in the WSDL. For an ABL client, the WSDL Analyzer produces definitions for a corresponding ProDataSet, its temp-tables, indexes, and data relations. A non-ABL client toolkit produces object definitions for the ProDataSet and for each of its temp-tables. Non-ABL clients toolkits do not produce code from the indexes and data relations.
The following code snippet defines a ProDataSet with nested and non-nested data relations:
/* getCustOrders.p */
DEFINE TEMP-TABLE ttCust     NO-UNDO
       FIELD      CustNum    AS INTEGER
       FIELD      Name       AS CHARACTER
       INDEX      CustNumIdx IS UNIQUE PRIMARY CustNum.

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

DEFINE TEMP-TABLE ttOrderLine  NO-UNDO
       FIELD      OrderNum     AS INTEGER
       FIELD      LineNum      AS INTEGER
       INDEX      OrderLineIdx IS UNIQUE PRIMARY OrderNum LineNum.

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

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 getCustOrders.p using the Doc/Lit SOAP format. Note the differences between the nested and non-nested data relations in this sample:

DATASET parameter for Doc/Lit

<!-- dataset definition -->
<element name="dsCustOrd" prodata:proDataSet="true">
  <complexType>
    <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="ttCust">
        <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">
        <complexType>
          <sequence>
            <element name="OrderNum" nillable="true" type="xsd:int"/>
            <element name="CustNum" nillable="true" type="xsd:int"/>
            <!-- nested data relation between ttOrder and ttOrderLine -->
            <element maxOccurs="unbounded" minOccurs="0"
                     name="ttOrderLine">
              <complexType>
                <sequence>
                 <element name="OrderNum" nillable="true" type="xsd:int"/>
                 <element name="LineNum" nillable="true" type="xsd:int"/>
                </sequence>
              </complexType>
            </element>
          </sequence>
        </complexType>
      </element>
    </sequence>
  </complexType>
  <unique name="CustNumIdx" prodata:primaryIndex="true">
    <selector xpath="Sn:.//ttCust"/>
    <field xpath="Sn:CustNum"/>
  </unique>
  <unique name="OrderNumIdx" prodata:primaryIndex="true">
    <selector xpath=".//Sn:ttOrder"/>
    <field xpath="Sn:OrderNum"/>
  </unique>
  <unique name="CustOrdIdx">
    <selector xpath="Sn:.//ttOrder"/>
    <field xpath="Sn:CustNum"/>
    <field xpath="Sn:OrderNum"/>
  </unique>
  <unique name="OrderLineIdx" prodata:primaryIndex="true">
    <selector xpath=".//Sn:ttOrderLine"/>
    <field xpath="Sn:OrderNum"/>
    <field xpath="Sn:LineNum"/>
  </unique>
  <!-- non-nested data relation between ttCust and ttOrder -->
  <keyref name="CustOrdRel" refer="Sn:CustNumIdx">
    <selector xpath="Sn:.//ttOrder"/>
    <field xpath="Sn:CustNum"/>
  </keyref>
  <!-- nested data relation between ttOrder and ttOrderLine -->
  <keyref name="OrdLinesRel" prodata:nested="true" refer="Sn:OrderLineIdx">
    <selector xpath="Sn:.//ttOrderLine"/>
    <field xpath="Sn:OrderNum"/>
  </keyref>
</element>
Note: Sn refers to the namespace prefix for the XML Schema containing the dataset's definition.
For RPC styles, the name of the ProDataSet parameter follows the format, PDSnameParam, where PDSname is the name of your ProDataSet. Both RPC styles use the same structure to define a ProDataSet parameter. The following WSDL sample defines the ProDataSet parameter using the RPC/Literal SOAP format. Note the differences between the nested and non-nested data relations in this sample:

DATASET parameter for RPC/Literal and RPC/Encoded

<!-- dataset definition -->
<complexType name="dsCustOrdParam" prodata:proDataSet="true">
  <sequence>
    <element maxOccurs="unbounded" minOccurs="0" name="ttCust">
      <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">
      <complexType>
        <sequence>
          <element name="OrderNum" nillable="true" type="xsd:int"/>
          <element name="CustNum" nillable="true" type="xsd:int"/>
          <!-- nested data relation between ttOrder and ttOrderLine -->
          <element maxOccurs="unbounded" minOccurs="0" name="ttOrderLine">
            <complexType>
              <sequence>
                <element name="OrderNum" nillable="true" type="xsd:int"/>
                <element name="LineNum" nillable="true" type="xsd:int"/>
              </sequence>
            </complexType>
          </element>
        </sequence>
      </complexType>
    </element>
  </sequence>
  <annotation>
    <appinfo>
      <unique name="CustNumIdx" prodata:primaryIndex="true">
        <selector xpath=".//Sn:ttCust"/>
        <field xpath="Sn:CustNum"/>
      </unique>
      <unique name="OrderNumIdx" prodata:primaryIndex="true">
        <selector xpath=".//Sn:ttOrder"/>
        <field xpath="Sn:OrderNum"/>
      </unique>
      <unique name="CustOrdIdx">
        <selector xpath=".//Sn:ttOrder"/>
        <field xpath="Sn:CustNum"/>
        <field xpath="Sn:OrderNum"/>
      </unique>
      <unique name="OrderLineIdx" prodata:primaryIndex="true">
        <selector xpath=".//Sn:ttOrderLine"/>
        <field xpath="Sn:OrderNum"/>
        <field xpath="Sn:LineNum"/>
      </unique>
      <!-- non-nested data relation between ttCust and ttOrder -->
      <keyref name="CustOrdRel" refer="Sn:CustNumIdx">
        <selector xpath=".//Sn:ttOrder"/>
        <field xpath="Sn:CustNum"/>
      </keyref>
      <!-- nested data relation between ttOrder and ttOrderLine -->
      <keyref name="OrdLinesRel" prodata:nested="true"
              refer="S
n:OrderLineIdx">
        <selector xpath=".//Sn:ttOrderLine"/>
        <field xpath="Sn:OrderNum"/>
        <field xpath="Sn:LineNum"/>
      </keyref>
    </appinfo>
  </annotation>
</complexType>
* Including before-image data
* Using NAMESPACE-URI attributes