Release 10.1A: OpenEdge Development:
Web Services

> ## Simple data types

> Simple data types represent the foundation for all types of data. The mappings for simple data types and how they can be transformed between Web services and the Progress 4GL provide the basic information for how to work with more complex types of data.

> ##### Suggested mappings

> OpenEdge suggests recommended mappings between Web service parameters and Progress 4GL parameters in the generated documentation produced by the WSDL Analyzer. These are the mappings that are most semantically useful. Note also that wherever the WSDL file indicates that a parameter of any data type is `nillable`, this means that on the Web service side the parameter can have the null value and on the Progress 4GL side the parameter can pass the 4GL Unknown value (`?`).

> Table 8–9 lists all the simple XML Schema data types in alphabetical order, showing for each one the Progress 4GL data type that OpenEdge suggests for mapping it. The table also provides notes on these mappings where appropriate.

> Table 8–9: Suggested XML Schema mappings to Progress 4GL
> data types
> XML Schema data type | 4GL data type | Notes
> --- | --- | ---
>     anyURI
>     CHARACTER
> | –
>     base64Binary
>     MEMPTR
> | You can use the 4GL `BASE64-ENCODE` and `BASE64-DECODE` functions to convert between Base 64 clear text (`CHARACTER` or `LONGCHAR`) and binary data (`RAW` or `MEMPTR`).
>     boolean
>     LOGICAL
> | –
>     byte
>     INTEGER
> | On `INPUT`, if the 4GL `INTEGER` value is outside the valid range of the XML Schema `byte` type, it is a run-time error.
>     date
>     DATE
> | On `OUTPUT`, the time zone information is lost. To retain it, use a 4GL `CHARACTER` parameter.
>     dateTime
>     DATETIME-TZ
> | –
>     decimal
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `decimal` value. However, it is common in the industry to do a mapping between XML Schema `decimal` and another decimal data type. On `OUTPUT`, if the XML Schema `decimal` value overflows the 4GL `DECIMAL` type, it is a run-time error.
>     double
>     CHARACTER
> | –
>     duration
>     CHARACTER
> | –
>     ENTITIES
>     CHARACTER
> | –
>     ENTITY
>     CHARACTER
> | –
>     float
>     CHARACTER
> | –
>     gDay
>     CHARACTER
> | –
>     gMonth
>     CHARACTER
> | –
>     gMonthDay
>     CHARACTER
> | –
>     gYear
>     CHARACTER
> | –
>     gYearMonth
>     CHARACTER
> | –
>     hexBinary
>     MEMPTR
> | –
>     ID
>     CHARACTER
> | –
>     IDREF
>     CHARACTER
> | –
>     IDREFS
>     CHARACTER
> | –
>     int
>     INTEGER
> | –
>     integer
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `integer` value, but it is far more likely to do so than the 4GL `INTEGER` type. On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `integer` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `integer` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     Language
>     CHARACTER
> | –
>     long
>     DECIMAL
> | On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `long` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `long` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     Name
>     CHARACTER
> | –
>     NCName
>     CHARACTER
> | –
>     negativeInteger
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `negativeInteger` value, but it is far more likely to do so than the 4GL `INTEGER` type. On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `negativeInteger` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `negativeInteger` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     NMTOKEN
>     CHARACTER
> | –
>     NMTOKENS
>     CHARACTER
> | –
>     nonNegativeInteger
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `nonNegativeInteger` value, but it is far more likely to do so than the 4GL `INTEGER` type. On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `nonNegativeInteger` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `nonNegativeInteger` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     nonPositiveInteger
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `nonPositiveInteger` value, but it is far more likely to do so than the 4GL `INTEGER` type. On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `nonPositiveInteger` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `nonPositiveInteger` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     normalizedString
>     CHARACTER
> | –
>     NOTATION
>     CHARACTER
> | –
>     positiveInteger
>     DECIMAL
> | The 4GL `DECIMAL` type may not hold the entire XML Schema `positiveInteger` value, but it is far more likely to do so than the 4GL `INTEGER` type. On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `positiveInteger` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `positiveInteger` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     qName
>     CHARACTER
> | –
>     short
>     INTEGER
> | On `INPUT`, if the 4GL `INTEGER` value is outside the valid range of the XML Schema `short` type, it is a run-time error.
>     string
>     CHARACTER
> | –
>     time
>     INTEGER
> | On `INPUT`, the value is converted with no time zone information.
>     token
>     CHARACTER
> | –
>     unsignedByte
>     INTEGER
> | On `INPUT`, if the 4GL `INTEGER` value is outside the valid range of the XML Schema `unsignedByte` type, it is a run-time error.
>     unsignedInt
>     DECIMAL
> | On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `unsignedInt` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `unsignedInt` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     unsignedLong
>     DECIMAL
> | On `INPUT`, if the 4GL `DECIMAL` value is outside the valid range of the XML Schema `unsignedLong` type, it is a run-time error. On `OUTPUT`, if the value of the XML Schema `unsignedLong` value is outside the valid range of the 4GL `DECIMAL` type, it is a run-time error.
>     unsignedShort
>     INTEGER
> | On `INPUT`, if the 4GL `INTEGER` value is outside the valid range of the XML Schema `unsignedShort` type, it is a run-time error.

> ##### Interacting with XML Schema data formats

> You might need to work directly with an XML Schema value whose format is not represented among the supported formats for the suggested Progress 4GL data type mapping, for example, a 51-digit decimal value. To handle this requirement, you can pass an XML Schema-formatted string version of the value into or out of the Web service invocation. OpenEdge automatically passes the XML Schema-formatted value when you map either a `CHARACTER` or `LONGCHAR` data type to any XML Schema data type that has a suggested mapping (see Table 8–9) other than `CHARACTER` or `LONGCHAR`.

> When you pass the XML Schema-formatted value as an `INPUT` parameter, the Web service invocation incorporates it directly into the generated SOAP message. For an `OUTPUT` parameter, the invocation copies the XML Schema-formatted value directly from the SOAP message into the `CHARACTER` or `LONGCHAR` parameter.

> When you pass an XML Schema-formatted value to a Web service, the invocation also validates the format of the value to ensure that it conforms to XML Schema formatting rules for the data type. Note that the invocation does not validate any facets declared in the `<schema>` element to constrain the value. It ensures that the format of the value you provide is valid according to its base XML Schema data type representation, but not, for example, if the value falls within a given range.

> Thus, for example, if you pass a Progress 4GL `CHARACTER` as an `INPUT` parameter for an XML Schema `int`, the invocation checks to ensure that it contains a properly formatted 32-bit integer value. If you pass a Progress 4GL `CHARACTER` as an `OUTPUT` parameter for an XML Schema `int`, the invocation copies the Schema-formatted value directly from the SOAP message into the 4GL `CHARACTER` parameter.

> ##### Data type casting

> As described previously, OpenEdge supports a set of alternative Progress 4GL data types (in addition to a suggested data type) to represent the value for an XML Schema data type in the Progress 4GL. These alternative data types essentially force the Web service invocation to cast the value between the specified native Progress 4GL representation and the corresponding XML Schema data type. The result of this casting might not preserve as much accuracy as the suggested mapping.

> Table 8–10 shows all the supported castings (alternative mappings) between the XML Schema and Progress 4GL data types. The suggested Progress 4GL data type mapping (see Table 8–9) for each XML Schema type appears in bold font. For a detailed description of how OpenEdge casts each supported mapping, see Appendix D "Data Type Casting Rules for Progress 4GL Calls to Web Services."

> Note: OpenEdge supports no castings for the `RECID`, `ROWID`, or `HANDLE` 4GL data types.

> Table 8–10: Supported casts between XML Schema and Progress 4GL
> data types
> XML Schema data type | Progress 4GL data type
> --- | ---
>     anyURI
>     CHARACTER
>     LONGCHAR
>     base64Binary
>     CHARACTER
>     LONGCHAR
>     MEMPTR
>     RAW
>     boolean
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     byte
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     date
>     CHARACTER
>     DATE
>     DATETIME
>     DATETIME-TZ
>     dateTime
>     CHARACTER
>     DATE
>     DATETIME
>     DATETIME-TZ
>     decimal
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     double
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     duration
>     CHARACTER
>     LONGCHAR
>     ENTITIES
>     CHARACTER
>     LONGCHAR
>     ENTITY
>     CHARACTER
>     LONGCHAR
>     float
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     gDay
>     CHARACTER
>     LONGCHAR
>     gMonth
>     CHARACTER
>     LONGCHAR
>     gMonthDay
>     CHARACTER
>     LONGCHAR
>     gYear
>     CHARACTER
>     LONGCHAR
>     gYearMonth
>     CHARACTER
>     LONGCHAR
>     hexBinary
>     CHARACTER
>     LONGCHAR
>     MEMPTR
>     RAW
>     ID
>     CHARACTER
>     LONGCHAR
>     IDREF
>     CHARACTER
>     LONGCHAR
>     IDREFS
>     CHARACTER
>     LONGCHAR
>     int
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     integer
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     Language
>     CHARACTER
>     LONGCHAR
>     long
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     Name
>     CHARACTER
>     LONGCHAR
>     NCName
>     CHARACTER
>     LONGCHAR
>     negativeInteger
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LONGCHAR
>     NMTOKEN
>     CHARACTER
>     LONGCHAR
>     NMTOKENS
>     CHARACTER
>     LONGCHAR
>     nonNegativeInteger
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     nonPositiveInteger
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     normalizedString
>     CHARACTER
>     DATE
>     DATETIME
>     DATETIME-TZ
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     NOTATION
>     CHARACTER
>     LONGCHAR
>     positiveInteger
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LONGCHAR
>     qName
>     CHARACTER
>     LONGCHAR
>     short
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     string
>     CHARACTER
>     DATE
>     DATETIME
>     DATETIME-TZ
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     time
>     CHARACTER
>     INTEGER
>     LONGCHAR
>     token
>     CHARACTER
>     LONGCHAR
>     unsignedByte
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     unsignedInt
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     unsignedLong
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR
>     unsignedShort
>     CHARACTER
>     DECIMAL
>     INTEGER
>     LOGICAL
>     LONGCHAR

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