Adding a REST binding to the EGL deployment descriptor

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:
  1. Open the EGL Deployment Descriptor editor by double-clicking the name of an EGL deployment descriptor.
  2. Click Resource Bindings. The Resource Bindings Configuration tab is displayed.
  3. Click Add. The Add a Resource Binding page is displayed.
  4. Click REST service binding and then click Next. The Add a REST Service Binding page is displayed.
  5. 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:
    1. Click the Browse button that is next to the REST service binding name field. The Interface Selection window is displayed.
    2. Select the name of the Interface part that is the basis of a service-access variable in your code.
    3. Click OK.
    You specify the service-binding name when you declare a service-access variable and set the Resource annotation, bindingKey field.
  6. 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.
  7. 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.”

  8. Click Finish. The Service Bindings Configuration tab is available again.
In the future, you can update the service binding that you just defined:
  1. Open the Resource Bindings tab.
  2. Select the binding.
  3. 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.