Show TOC

Data Type Handling by the Web Service ConnectorLocate this document in the navigation structure

Use

The Web Service Connector handles the various possible data types sent to/returned from a Web service depending on how the data is rendered in the portal:

  • By writing Java code, in which case the developer decides how to implement the display of the data returned

  • By means of automatic tools, such as the iView wizard

In either case, you need to consider the properties of the Web Service system template within the system administration framework of the portal, described below.

Mapping WSDL Schema Elements to Connector Framework Data Types

The following table shows how the Web Service Connector maps WSDL schema elements to connector framework data types.

XSD Schema Element

Connector Framework Datatype

Sample/Remarks

<xsd:element> with xsd primitive type attribute value

Field

<xsd:element name="Name" type="xsd:string"/>

<xsd:all>

Record

<xsd:element> with 1 or more attributes <xsd:attribute>

Record

Where the first field of the record represents the element and all the element attributes are the following record fields

<xsd:sequence>

Recordset

Portal Properties of the Web Service System

The Web Service system in the portal has the following properties under the Web Service category:

Property

Values

Description

Force SAP UI Parameter Management

Y/N

Default value: Y

Declares whether or not the Web Service Connector will rearrange input/output parameters of the specific Web service in order to adhere to the SAP UI Parameters standard.

WSDL Caching Days

none/1/30/infinite

Default value: 1 (day)

Caching period of the WSDL file

WSDL URL

A valid URL

The URL of the Web service WSDL

Forcing SAP UI Parameter Management

Regarding how the connector deals with the data types of Web service input/output parameters, it is this system property that concerns the content developer.

Value 'N'

If this flag is off (the value is N ), the Web Service Connector does nothing while processing the Web service WSDL file. The connector framework supports all input/output data structures:

  • Field - of primitive type (for example, int, String, double, etc.)

  • Array - such as a column in a table (not currently supported by the Web Service Connector)

  • Record - a set of fields

  • Recordset - collection of records (table structure)

When one of the fields of a record, or one of the columns of recordset contains data of type record, or recordset, automatic UI tools will not be able to create iViews displaying parameters returned by the Web Service Connector, if their data structure is non-compliant or "nearly flat" (explanation below). The developer can use the connector framework API as desired. (See the code sample using the Google Web service.)

Value 'Y'

The Web Service Connector can pass all returned data to automatic SAP UI tools. However, it is not able to pass nested data as such. The connector is only able to pass data that is "flat," or "nearly flat."

If the Force SAP UI Parameter Management flag is on ( Y is selected), the Web Service Connector manipulates the metadata from the WS WSDL so that it appears as flat.

SAP UI-Supported Data Structures

The data structure of input/output parameters that the Web Service Connector supports, for consumption by SAP UI tools, are flat or nearly flat, as described below:

  1. A primitive data type (byte, short, int, long, float, double, char, boolean) - is a flat data structure.

  2. A record whose fields:

    • contain data of primitive types - is a flat data structure

    • contain records, the fields of which contain primitive types, or more records that comply with this definition recursively - is a nearly flat data structure

  3. A recordset (table), the columns of which comply with these rules, as described in (1), is flat, or (2), is nearly flat.

Non-Compliant Data Structures

The following are data structures that do not comply with SAP UI parameter management:

  • Records, one or more fields of which are of type recordset

  • Recordsets, one or more columns of which are of type recordset

Web Service Connector Handling of Data Structures

If the Force SAP UI Parameter Management property value is Y , the possibilities of how variable parameters are handled by the Web Service Connector depends on the compliance of the data structure type, as defined here.

Parameter data structure is flat

If the parameter values returned are of flat data type, no special handling is required of the connector.

Parameter data structure is nearly flat

The Web Service Connector converts the nearly flat parameters to flat. It does this by parsing the non-primitive structures (record fields, recordset columns) into their constituent primitives, and concatenating the names, which are displayed as flat.

For example:

A table, Employees, has a record for each employee that comprises the fields: Employee Name (string), Employee ID (int), and Address (record).

Address, one of the columns returned by the Employee recordset, is a record comprising three fields: City (string), Street (string), HouseID. (int).

The Web Service Connector exposes the metadata from this Web service in a flat list as follows:

  • Name (string)

  • ID (int)

  • Address_City

  • Address_Street (string)

  • Address_HouseID (int)

Parameter data structure contains is not "flat" or "nearly flat"

If a record contains a field or a column, the data structure of which is of type recordset, the Web Service Connector extracts the nested (child) recordset from the record/recordset, and presents it as a new, separate input/output parameter value, and reduces 1 from the number of the record fields/recordset columns.

For example:

Taking another look at the above example of the Employees table, if the Address field were of type recordset, instead of record, the result returned would be:

  • The Employees table with two columns:

    • Name (string)

    • ID (int)

      and

  • A new parameter of type recordset, with the name 'Employees_Address', which is an Address table with three columns:

    • City

    • Street (string)

    • HouseID (int)

Note that the linkage between these two recordsets is lost. In some cases, this might be useful, where the output of one of the recordsets has no business value. If, however, it is important to keep this linkage, then the Force SAP UI Parameter Management flag in the portal Web service system properties should be turned off ( N is selected), Java code must be written to display the data.

When consuming such a Web service, in most cases, an automatic UI tool, such as the portal iView wizard, would support the display of only one of the output tables. The iView wizard allows you to choose which to display. Other tools may allow the display of more than one output parameter.

If the Force SAP UI Parameter Management property value is N , there are no non-compliant data types. The Web Service Connector handles all connector framework data types, except arrays.