A REST service binding gives details necessary to access
a REST or EGL REST-RPC service.
- Open the EGL Deployment Descriptor editor by double-clicking an
EGL deployment descriptor. If you need to create the file, see “Creating
an EGL deployment descriptor.”
- Click Service Bindings. The Service
Bindings Configuration tab is displayed.
- Click Add. The Add a Service
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 @BindService property, 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.
The value of this field overrides the setting of the defaultSessionCookieID build
descriptor option.
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 Service Bindings Configuration tab.
- Select the binding.
- Edit the displayed information.
The tab includes the
enableGenerate check
box. The purpose of that check box is as follows:
- For requesters being generated to COBOL, this option specifies
whether to generate the web service access layer when you generate
the deployment descriptor. You must generate the web service access
layer at least once so that EGL will create the code necessary to
access the service. After you have generated the web service access
layer, you do not need to generate it again unless you change the
information in the service binding. Generating the web service access
layer can be time-consuming, so you might want to clear this check
box to save time.
- For requesters being generated to Java™,
this option specifies whether to add binding information to the binding
file in the generated output. This information is required, so you
must select this option for requesters being generated to Java.