Show TOC Start of Content Area

Background documentation Data Type Handling by the Web Service Connector  Locate the document in its SAP Library structure

How the Web Service Connector handles the various possible data types sent to/returned from a Web service depends on the means by which the data is to be 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, attention must be first turned to the properties of the Web Service system template within the system administration framework of the portal.

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.

WSDL to Connector Framwork Data Type Mapping

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, under category Web Service, three properties:

Web Service System Properties

Parameter

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’ Chosen

If this flag is off (the value selected 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’ Chosen

The Web Service Connector is capable of passing all data returned to automatic SAP UI tools. However, it is not capable of passing nested data as nested data. 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 will manipulate the metadata it will parse from the WS WSDL so that it will appear as flat. The next section describes the supported data structures.

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.” This means that an input/output parameter may be either:

...

       1.      a primitive data type (byte, short, int, long, float, double, char, boolean)

We call this a flat data structure.

       2.      a record whose fields:

¡        contain data of primitive types—also called a flat data structure

or

¡        contain records, the fields of which contain primitive types, or more records that comply with this definition recursively—called a nearly flat data structure

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

In order to emphasize for the sake of clarity:

1

Field

Containing primitives: this is flat and complies with (1)—above

2

Record

A set of fields that comply with (1), in which case it is flat, or (2), in which case it is nearly flat

3

Recordset ()

A table, the columns of which comply with (1), in which case it is flat, or (2), 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

In the event that the Force SAP UI Parameter Managementproperty value is T, 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”

In the event that:

·        a record contains a field, the data structure of which is of type recordset

or

·        a recordset contains 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)

It should be noted that the linkage between these to 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.

Reminder: In the event that the Force SAP UI Parameter Managementproperty value is N, there are no non-compliant data types. The Web Service Connector handles all connector framework data types, except arrays.

 

 

End of Content Area