Release 10.1A: OpenEdge Development:
Web Services

> ## Defining TABLE (static temp-table) parameters

> `TABLE` parameters pass data only, because the static temp-table schema is known at WSDL generation. Progress 4GL Web services map a `TABLE` definition to a `<complexType>` consisting of a `<sequence>` of elements that represent a row (Progress record). Each `<element>` in this sequence represents a column (Progress field) of the row. For all SOAP formats, a `TABLE` parameter is defined as a `<complexType>` that references the corresponding row element `<complexType>`.

> Client-development toolkits typically define an object for every `<complexType>` representing a temp-table row. The client application then creates the TABLE parameter by creating an array of temp-table row object instances.

> The following examples show some `<complexType>` definitions for `TABLE` rows and parameters.

> The following WSDL sample defines a `TABLE` row named, `staticTT_ttEmpRow`, with two columns, `Name` and `Number`:

> TABLE parameter row schema for all SOAP formats
>     <complexType name="staticTT_ttEmpRow">
>        <sequence>
>           <element name="Name" nillable="true" type="xsd:string"/>
>           <element name="Number" nillable="true" type="xsd:int"/>
>        </sequence>
>     </complexType>

> The following WSDL sample defines a temp-table parameter for the `ttEmp` row using the RPC/Encoded SOAP format. Note that the parameter is a SOAP array of rows:

> TABLE parameter for RPC/Encoded
>     <complexType name="ArrayOfstaticTT_ttEmpRow">
>        <complexContent>
>           <restriction base="soapenc:Array">
>              <attribute ref="soapenc:arrayType"
>                 wsdl:arrayType="S2:staticTT_ttEmpRow[]"/>
>           </restriction>
>        </complexContent>
>     </complexType>

> The following WSDL sample defines a `TABLE` parameter using the RPC/Literal or Document/Literal SOAP formats. Note that the parameter is a sequence of multiple rows:

> TABLE parameter for RPC/Literal and Document/Literal
>     <complexType name="staticTT_ttEmpParam">
>       <sequence>
>         <element maxOccurs="unbounded"
>              minOccurs="0" name="ttEmpRow" type="S2:staticTT_ttEmpRow" />
>       </sequence>
>     </complexType>

> For these SOAP formats, the row element name (`ttEmpRow`) is used to identify each element that holds a data row sent in SOAP messages that pass a `TABLE` parameter.

> Following are general formats for `TABLE` parameters in SOAP messages. For an RPC/Encoded Web service, the `TABLE` parameter is represented as a SOAP array of `TABLE` rows, where each row is encapsulated by an `<Item>` element:

> TABLE parameters—general RPC/Encoded format
>           <Item> <!--- row instance 1 --> </Item>
>           <Item> <!--- row instance 2 --> </Item>
>           <Item> <!--- row instance 3 --> </Item>
>           ...

> In RPC/Encoded SOAP messages passing `TABLE` parameters, you might notice XML like this:

>           <Item href="#id2"/>
>           ...
>           <...id="id2">
>             <!--- row instance 1 -->
>             <!--- row instance 2 -->
>             <!--- row instance 3 -->
>             ...
>           </...>

> Some client toolkits use the SOAP encoding `href` attribute to reference the data in a SOAP array for a given row instance at a different location in the message (indicated by the `id` attribute with the corresponding value). The WSA, however, does not use this indirect form of data reference for `TABLE` parameters in RPC/Encoded SOAP messages.

> For an RPC/Literal or Document/Literal Web service, the `TABLE` parameter is represented as a `<sequence>` of `TABLE` row elements. Each element is named after the row `<element>` in the `<complexType>` used to define the `TABLE` row for the parameter. This WSDL-named row `<element>` corresponds to the `<Item>` element used to represent SOAP array rows in RPC/Encoded Web services.

> Thus, using the sample row element named `ttEmpRow`, a SOAP message contains a `TABLE` parameter for this row definition in the following form:

> TABLE parameters—general Document (or RPC)/Literal format
>           <ttEmpRow> <!-- row instance 1 --> </ttEmpRow>
>           <ttEmpRow> <!-- row instance 2 --> </ttEmpRow>
>           <ttEmpRow> <!-- row instance 3 --> </ttEmpRow>
>           ...

> Each column of a `TABLE` row can hold any data type shown in Table 4–3.

> Table 4–3: XML data types for TABLE (static temp-table) parameter columns
> Progress 4GL data type | XML Schema data type
> --- | ---
>     BLOB1
>     xsd:base64Binary
>     CHARACTER
>     xsd:string
>     CLOB1
>     xsd:string
>     COM-HANDLE
>     xsd:long
>     DATE
>     xsd:date
>     DATETIME
>     xsd:dateTime
>     DATETIME-TZ
>     xsd:dateTime
>     DECIMAL
>     xsd:decimal
> `INTEGER` (32 bit) |
>     xsd:int
>     LOGICAL
>     xsd:boolean
>     RAW
>     xsd:base64Binary
> `RECID` (32 or 64 bit) |
>     xsd:long
>     ROWID
>     xsd:base64Binary
>     WIDGET-HANDLE
>     xsd:long

> 1 `BLOB` and `CLOB` data types are designed to support very large objects. Use of these data types for table fields in Web services can result in a serious performance impact.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095