After you code an EGL Service part, you can use
that part as the basis of a service-access variable. However, this
usage is deprecated.
For the details on the preferred usage, see Accessing a dedicated service.
In the deprecated process, two cases are possible:
- If you are working in Rich UI, the only accessible EGL service
is a dedicated service, as explained in “Service access in Rich UI.”
You can use an Interface type to declare the variable, but can easily
use the Service type instead. Here is an example, which also references
the package name in which the Service type resides:
myService server.MyServiceType?{@dedicatedService};
If you use an Interface part, set the
serviceName annotation
field to the name of the Service type:
myService MyInterfaceType?
{@dedicatedService{serviceName = "server.MyServiceType"}};
After declaring the variable, use it in a call statement.
For details, see “Invoking a service asynchronously from a Rich UI
application.”
Important: Access of an EGL service from outside of
Rich UI is not available in the current version of EDT.
After you declare the variable and assign a service binding
to it, you use the variable in a service-access statement, as described
in “Invoking a service synchronously from outside of Rich UI.”
Defining an Interface part to access
a dedicated or local EGL service
Here is an example Interface
type that might be used to access a dedicated service:
Interface MyInterfaceType
Function GetEmployeeDetail(employeeCode STRING IN,
employeeSalary FLOAT OUT,
employeeStatus STRING INOUT)
returns(myEmployeeRecordPart);
end
The example includes a single function prototype,
but more are possible. Also, you can specify a variety of EGL data
types and can use the modifiers IN, OUT, and INOUT.
If you have
access to the EDT IDE, you can create the Interface part easily from
the Service part:
- In the Project Explorer, right click the EGL file that defines
the service.
- Click EGL Services > Extract EGL Interface.
- In the New EGL Interface part window, specify
the appropriate details and click Finish.
When accessing a non-SOAP service, avoid a possible runtime
error: do not use an Interface part that is derived from a WSDL file.
Setting a local binding in the
deployment descriptor
Assigning the local binding to the
service-access variable