There are a few rules for specifying parameters in a function
prototype.
An Interface (or Service) part is used for service access and includes
function prototypes such as the following one:
Function GetEmployeeDetail(employeeCode STRING IN,
employeeSalary FLOAT OUT,
employeeStatus STRING INOUT)
returns(myEmployeeRecordPart);
If the prototype is used to access an EGL REST or SOAP service
or an EGL service, the prototype can include IN, OUT, and INOUT parameters.
If the prototype is used to access a third-party REST service,
the following statements apply:
- The IN modifier is required for each parameter
- If a parameter is used to construct the URI or the query string,
the following rules apply:
- The name of the parameter must match the name of the substitution
variable in the URI template
- The data type of the parameter can be a primitive type or related
data item
- The primitive type must be STRING or one the following types,
which are assignment-compatible with STRING: FLOAT, BIN, or one of
the integer equivalents to BIN (INT, SMALLINT, or BIGINT)
- The value of a representation parameter can be a string, one of
the previously mentioned assignment-compatible types, or a non-structured
Record part whose only fields fulfill the following rules:
- The field is of type STRING or is assignment-compatible with STRING.
- The field is based on a non-structured Record part. Specifically,
the field can be based on a Record part that includes only strings
(or assignment-compatible values) or other non-structured Record parts.
The nesting of records within records can be to any level.
If the prototype is used to directly access an IBM® i service program by way of a native service-client
binding, the following rules apply: