EGL Reference Guide for iSeries

Setting up the TCP/IP listener

If you want a caller to use TCP/IP to exchange data with a called program in a J2EE application client module or with a called non-J2EE Java program, you must set up a TCP/IP listener for the called program.

TCP/IP for a called non-J2EE Java program

If you are using TCP/IP to communicate with a called non-J2EE Java program, you must configure a standalone Java program called CSOTcpipListener for that program. Specifically, you must do as follows:

You can start the standalone TCP/IP listener in either of two ways:

TCP/IP for a called program in a J2EE application client module

In the case of a called program in a J2EE application client module, you need to make sure that the following situation is in effect:

If you are working with projects at the level of J2EE 1.2, it is recommended that you set up an application client project that is initialized with the listener, before you generate any EGL code into that project. If you fail to follow that sequence (listener first, EGL code second) or if you are working with projects at the level of J2EE 1.3, you need to follow the procedure described in Providing access to the listener from an existing application client project.

Setting up an application client project that is initialized with the listener

To set up an application client project that is initialized with the listener, do as follows:

  1. Click File > Import.
  2. At the Select page, double-click App Client JAR file.
  3. At the Application Client Import page, specify several details--
    1. In the Application Client file field, specify the jar file that sets up access to (but does not include) the TCP/IP listener:
      installationDir\wstools\eclipse\plugins\
      com.ibm.etools.egl.generators_version\runtime\EGLTcpipListener.jar
      

      installationDir
      The WebSphere Studio installation directory, such as c:\myStudio
      version
      The latest version of the plugin; for example, 5.0.1.

      The TCP/IP listener itself resides in fdaj.jar, which is placed in the application client project when you first generate EGL code into that project.

    2. Click the New radio button, which follows the label Application Client project.
    3. Type the name of the application client project into the New Project Name field; then set or unset the Use default check box. If you set the check box, the project is stored in a workspace directory that is named with the name of the project. If you unset the check box, specify the project name in the New project location field.
    4. Specify the name of the enterprise application project that contains the application client project:
      • If you are using an existing J2EE 1.2 enterprise application project, click the Existing radio button, which follows the label Enterprise application project. In this case, specify the project name in the Existing project name field.
      • If you are creating a new enterprise application project, do as follows:
        1. Click the New radio button, which follows the label Enterprise application project.
        2. Type the name of the enterprise application project into the New Project Name field.
        3. Set or unset the Use default check box.
        4. If you set the check box, the project is stored in a workspace directory that is named with the name of the project. If you unset the check box, specify the project name in the New project location field.
  4. Click Finish.
  5. Ignore the two warning messages that refer to the jar files (fda.jar, fdaj.jar) that will be added automatically when you generate EGL output into the project.

In the application client project, the deployment descriptor property tcpiplistener.port is set to the number of the port at which the listener receives data. By default, that port number is 9876. To change the port number, do as follows:

  1. In the Project Navigator view, expand your application client project, then appClientModule, then META-INF
  2. Click application-client.xml > Open With > Deployment Descriptor editor
  3. The deployment descriptor editor includes a source tab; click that tab and change the 9876 value, which is the content of the last tag in a grouping like this:
    <env-entry-name>tcpiplistener.port</env-entry-name>
    <env-entry-type>java.lang.Integer</env-entry-name>
    <env-entry-value>9876</env-entry-value>
    
  4. To save the deployment descriptor, press Ctrl-S.

Providing access to the listener from an existing application client project

If you generate EGL code into an application client project that was not initialized with the listener, you need to update the deployment descriptor (application-client.xml) and the manifest file (MANIFEST.MF):

  1. In the Project Navigator view, expand your application client project, then appClientModule, then META-INF
  2. Click application-client.xml > Open With > Deployment Descriptor Editor
  3. The deployment descriptor editor includes a Source tab. Click that tab. In the text, immediately below the line that holds the tag <display-name>, add the following entries (however, if port 9876 is already in use on your machine, substitute a different number for 9876):

    <env-entry>
      <env-entry-name>tcpiplistener.port</env-entry-name>
      <env-entry-type>java.lang.Integer</env-entry-name>
      <env-entry-value>9876</env-entry-value>
    </env-entry>
    
  4. To save the deployment descriptor, press Ctrl-S.
  5. In the Project Navigator view, click MANIFEST.MF > Open With > JAR Dependency Editor.
  6. The JAR Dependency Editor includes a Dependencies tab. Click that tab.
  7. Review the Dependencies section to make sure that fda.jar and fdaj.jar are selected.
  8. In the Main Class section, in the Main-Class field, type the following value or use the Browse mechanism to specify the following value:
      CSOTcpipListenerJ2EE
    
  9. To save the manifest file, press Ctrl-S.

Deploying the application client project

To start the TCP/IP listener, follow either of two procedures:


Related tasks
Providing access to non-EGL jar files
Setting up the J2EE run-time environment for EGL-generated code


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]