Service part in EGL source format

For an overview of services, see EGL services. You can declare services in an EGL file, which is described in EGL source format.

The syntax diagram for a Service part is here:

Syntax diagram for an Service part
Service servicePartName ... end
Identifies the part as a service and specifies the part name. For the rules of naming, see Naming conventions.
implementsinterfaceName
Indicates that the service implements the specified interfaces. The primary meaning is that the service contains every function described in the interface. These statements also apply:
  • In an assignment statement, a variable of the interface type can receive a variable of the service type:
      myInterface = myService;
  • Similarly, in a function invocation, a parameter of the interface type can receive an argument of the service type

A service is not required to implement an interface even if you use the interface to access a function in the service.

propertyList
Every property is optional:
@WSDL
Is meaningful only when a variable that is based on the Service part is bound to a Web service.
Allows EGL to create the Web Service Description Language (WSDL) definition that is used for interacting with the Java™ JAX-RPC runtime code. The property fields and types are as follows:
elementName STRING
If this property field is present, the value sets the following names:
  • The WSDL definition file name
  • The name in the WSDL portType element
  • The name of the binding element; but the element name also has the suffix Binding
  • The name of the service element; but the element name also has the suffix Service

If the property field is not present, the name of the Service part is used for the above-stated purposes.

The data is case sensitive: for example, the name myService is different from MYSERVICE.

nameSpace STRING
Sets the global, target namespace for the WSDL definition. If the property field is not present, the value is created by starting with the string http:// and inverting every qualifier in the package name; for example, if the package name is com.ibm.egl, the value of nameSpace is as follows:
  http://egl.ibm.com

The value is case sensitive: for example, the namespace http://egl.ibm.com is different from http://EGL.IBM.com.

isLastParamReturnValue BooleanKind
This property field is ignored in the context of a Service part.
alias STRING
Identifies a string that is incorporated into the names of generated output. If you do not set the alias property, the service-part name is used instead.
localSQLScope BooleanKind
Indicates whether identifiers for SQL result sets and prepared statements are local to the service code during invocation by other EGL code, as is the default. If you accept the value yes, different programs can use the same identifiers independently, and the EGL code that uses the service can independently use the same identifiers as are used in the service.

If you specify no, the identifiers are shared throughout the run unit. The identifiers created when the SQL statements in the service is invoked are available in other code that invokes the service, although the other code can use localSQLScope = yes to block access to those identifiers. Also, the service may reference identifiers created in the invoking code, but only if the SQL-related statements were already run in the other code and if the other code did not block access.

The effects of sharing SQL identifiers are as follows:
  • You can open a result set in one code and get rows from that set in another
  • You can prepare an SQL statement in one code and run that statement in another

In any case, the identifiers available when the program or pageHandler accesses the service are available when the same program or pageHandler accesses the same or another function in the same service.

useDeclaration
Provides easier access to a dataTable or library. For details, see Use declaration.
private
Indicates that the function is unavailable outside the service. If you omit the term private, the function is available.

Variables and constants are necessarily private, but the qualifier is available.

fieldName
Name of a primitive field. For the rules of naming, see Naming conventions.
primitiveType
The primitive type of a field or (in relation to an array) the primitive type of an array element.
length
The parameter's length or (in relation to an array) the length of an array element. The length is an integer that represents the number of characters or digits in the memory area referenced either by fieldName or (in the case of an array) dynamicArrayName.
decimals
For a numeric type, you may specify decimals, which is an integer that represents the number of places after the decimal point. The maximum number of decimal positions is the smaller of two numbers: 18 or the number of digits declared as length. The decimal point is not stored with the data.
"dateTimeMask"
For TIMESTAMP and INTERVAL types, you may specify "dateTimeMask", which assigns a meaning (such as "year digit") to a given position in the datetime value. The mask is present with the data at run time.
dataItemPartName
The name of a dataItem part that is visible to the program. For details on visibility, see References to parts.

The part acts as a model of format, as described in Typedef.

recordName
Name of a record. For the rules of naming, see Naming conventions.
recordPartName
Name of a record part that is visible to the program. For details on visibility, see References to parts.

The part acts as a model of format, as described in Typedef.

constantName literal
Name and value of a constant. The value is either a quoted string or a number. For the rules of naming, see Naming conventions.
fieldProperty
A field-specific property-and-value pair, as described in Overview of EGL properties and overrides.
recordProperty
A record-specific property-and-value pair. For details on the available properties, see the reference topic for the record type of interest.

A basic record has no properties.

fieldName
Name of a record field whose properties you wish to override. See Overview of EGL properties and overrides.
arrayName
Name of a dynamic array. If you use this option, the other symbols to the right (dataItemPartName, primitiveType, and so on) refer to each element of the array.
size
Number of elements in the array. If you specify the number of elements, the array is initialized to the specified number of elements.
functionPart
A function. The following restrictions apply:
  • The return type cannot be of type ANY, BLOB, or CLOB.
  • A parameter cannot include a field of type ANY; cannot be of type ANY, BLOB, CLOB; cannot be of a loose type such as NUMBER; and cannot include the modifier field or nullable
  • Parameters with the modifier OUT must be at the end of the list of parameters
The following function property is valid only in a Service part and is meaningful only when the variable that is based on that part is bound to a Web service:
@WSDL
Allows EGL to extract data from the Web Service Description Language (WSDL) definition for use in interacting with the Java JAX-RPC runtime code. The property fields and types are as follows:
elementName STRING
If this property field is present, the value becomes the name in the WSDL operation element for the function. If the property field is not present, the function name is used. The data is case sensitive: for example, the name myFunction is different from MYFUNCTION.
nameSpace STRING
This property field is ignored in the context of a function.
isLastParamReturnValue BooleanKind
This property field is ignored in the context of a function.

For details, see Function part in EGL source format.

Related concepts
EGL interfaces
EGL services and Web services
Library part of type ServiceBindingLibrary

Related tasks
Creating an EGL Interface part
Creating an EGL Service part
Creating an Interface part from a Service part

Related reference
Best practices for services and related interfaces in EGL
Function part in EGL source format
Interface part in EGL source format
Interfaces of type BasicInterface

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.