A REST service binding gives details necessary
to access a REST or EGL REST-RPC service.
To add a REST binding to an EGL deployment descriptor, do
as follows:
- Open the EGL Deployment Descriptor editor by double-clicking
the name of an EGL deployment descriptor.
- Click Resource Bindings.
The Resource Bindings Configuration tab
is displayed.
- Click Add. The Add
a Resource Binding page is displayed.
- Click REST service binding and then
click Next. The Add
a REST Service Binding page is displayed.
- In the REST service binding name field,
specify the service-binding name, which is also called a key. You
can type the name or do as follows:
- Click the Browse button that
is next to the REST service binding name field.
The Interface Selection window is displayed.
- Select the name of the Interface part that is the basis
of a service-access variable in your code.
- Click OK.
You specify the service-binding name when you declare a service-access
variable and set the Resource annotation, bindingKey field.
- In the baseURI field, type a string
to identify the first qualifiers in the URI that is used to access
the service. The default value of baseURI is
an empty string.
- In the sessionCookieID field, type
the name of a session cookie, which is a string that identifies the
session cookie. The default value is JSESSIONID, which is always the
session ID when your application runs on Apache Tomcat. The
setting of sessionCookieID is meaningful
only in the following case:
- The service is an EGL external type that makes an IBM i called program or service program available
as an EGL REST-RPC service.
- The service logic is stateful, which means that the
requester and service can participate in a multistep conversation.
For background information, see “Accessing IBM i programs as web services: overview.”
- Click Finish. The Service
Bindings Configuration tab is available again.
In the future, you can update the service binding that you
just defined:
- Open the Resource Bindings tab.
- Select the binding.
- Edit the displayed information.
The tab includes the enableGenerate check
box. The purpose of that check box is to specify whether to add binding
information to the binding file in the generated output.