Service part reference
Service parts provide requesters with access to the functions in the service. A requester can be a local or remote program, handler, library, or another service.
If you are developing a Service part for deployment as a SOAP service,
you need to understand how the EGL-generated WSDL file represents
a function parameter, if the parameter is based on a structured Record
part with substructures. Here is an example Record part:
Record ORDER type BasicRecord
10 ORDERID char(5);
10 ORDERITEMS char(35)[10];
15 ITEMID char(5);
15 DESCRIPTION char(30);
end When constructing the WSDL file that guides the runtime transfer
of data, the EGL generator flattens the definition.
In essence, the WSDL representation is based on the following Record
part:
Record ORDER type BasicRecord
10 ORDERID char(5);
10 ITEMID char(5)[10];
10 DESCRIPTION char(30)[10];
end To retain the intended nesting of one field in another, use records
that are based on non-structured Record parts. For example, the following
code retains the ORDERITEMS field:
Record ORDER type BasicRecord
ORDERID char(5);
ORDERITEMS ANITEM[10];
end
Record ANITEM type BasicRecord
ITEMID char(5);
DESCRIPTION char(30);
end If you need to transfer data between complex structured and non-structured records in your service logic, use the MOVE statement.
For more information about Service parts, see Services: a top-level overview.
Syntax

- serviceName
- The name that you assign to the service.
- interfaceName
- The name of the interface that this service implements. This variable is a guarantee that the service contains every function described in the interface.
- serviceContents
- Services can contain functions, variables, constants, and use declarations. Functions can include the private qualifier so that the requester cannot access them. Variables and constants are not available to the requester.
Example
The following example
shows a simple service:
Service EchoString
function returnString
(inputString string in)
returns (string)
return (inputString);
end
end
Compatibility
| Platform | Issue |
|---|---|
| COBOL generation | The maximum length of a generated service name is 7 characters. |
| IMS/VS, IMS™ BMP | Service part is not supported. |
| Rich UI | With one exception, Service generation is not
supported in a Rich UI project. The exception is a dedicated service,
as described in EGL support for SOA." you can write service logic in an EGL general or EGL web project, use that logic as the basis of a SOAP web service or REST service (which must be generated into an EGL web project), deploy that service to a web server, and access the deployed service from a Rich UI application. |
| VSE | Service part is not supported. |