Adding a REST binding to the deployment descriptor

A REST service binding gives details necessary to access a REST or EGL REST-RPC service.
  1. 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.”
  2. Click Service Bindings. The Service Bindings Configuration tab is displayed.
  3. Click Add. The Add a Service 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 @BindService property, 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.

    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.”

  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 Service Bindings Configuration tab.
    2. Select the binding.
    3. 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.

Feedback