Getting Started-JetNet

Lesson 8 . Defining Services

The service component that you saved in Lesson 7 contains service routines that display data on the client screen and allow the client to update the database. In Lesson 4, you defined a service, test, in the JIF, and identified the service routine and service component.

All services must be defined for your application in the JIF, an interface file that maps each service name to a service routine and component. The JIF also defines other attributes of a service, such as its input and output requirements.

In general, the JIF is accessed for these reasons:

If service components were created with the screen wizard, you must update the JIF with definitions of the services that are associated with that service component. The JIF has its own editor which lets you access those service definitions and edit them, or add new definitions for services that you create yourself.

In this lesson you learn how to:

  1. If necessary, reactivate the application from the server machine (refer to page 1-15 for UNIX and refer to page 1-28 for Windows).

Invoke the JIF Editor

You can add and update services while you are using the editor by invoking the JIF editor.

  1. Invoke the JIF editor by doing one of the following, depending on your platform:

    UNIX: Start the editor, and choose ToolsJIF Editor.

  2. Enter any needed information, and choose OK.

    If the information is correct, that is, if it matches the entries you made in your server setup, you are connected to the middleware and the JIF editor workspace opens. The View Services dialog box is displayed showing the test service you defined (Lesson 3) in the jif.bin from the remote common.lib.

    Note: (Windows only) If you did not set the SMFLIBS variable in the jifedtut.ini to open the remote common.lib (host!common.lib), choose FileOpenRemote Library and select the remote common.lib that resides in the proltut directory. Choose FileOpenJIF and select the jif.bin library member.

    If the connection to the middleware is invalid or is not made, the JIF editor opens, but you will not have access to common.lib on the application server. In addition, updates to the JIF will not take effect and new services will not be advertised since the server won't know of the changes.

    Determine the correct host name (SMRBHOST) and port value (SMRBPORT), and under UNIX, the broker.bin (SMRBCONFIG) location. Try connecting to the middleware by entering the correct values in the Connect dialog box.

Define a service

Define services to carry out basic database transaction requests. For the screen you just created with the screen wizard, you want to define services that let users add, update, select, and delete distributor records.

  1. Choose ServiceCreate or .

    The Create Service dialog box opens.

  2. Enter distributor_d in the Service Name field and press TAB.

    The JIF editor supplies the routine name, in this case delete, because of the _d suffix in the Service Name. It also provides a default service component name—using the prefix of the service name.

  3. Press TAB to advance to the Service Component field.
  4. Change the service component name to dstord (to match the name you provided in the editor when you saved the service component to server.lib).

  5. Choose Add.

    The fields clear so that you can create another service.

More About Service Options

There are additional service specifications you can define in the JIF that let you control such things as:

By default, the JIF uses the service name to determine the transaction type; therefore, a service name that ends with _i sets the service to the transaction manager Insert operation. In addition, the Cache Service Component option by default is set to open or cache a service's service component when the service is advertised by the server.Repeat steps 5 through 8 for each of the other services: distributor_i, distributor_s, and distributor_u. Remember to provide the correct name of the service component, dstord.

  1. Repeat steps 5 through 8 for each of the other services: distributor_i, distributor_s, and distributor_u. Remember to provide the correct name of the service component, dstord.
  2. After you create all four services, choose Close to close the Create Services dialog box.

    The View Services dialog box displays the services you created.

  3. Choose FileSave or .

    Since you are connected to the middleware, servers are notified immediately when changes are saved to the JIF. In addition, new services (depending on the advertise specification and if the server is configured to advertise all services) are advertised and immediately available to your application.

  4. Choose FileExit.

    You are prompted to release the reservation on the JIF since it is stored in a remote library and is shared by others.

  5. Choose Yes to release the reservation.

    The JIF editor closes.

What did you do?

In this lesson, you invoked the JIF editor and:

What did you learn?

You learned: