Deploy the REST Web Service

Walks you through the steps required to prepare the ProgramREST project and MakeCheckAppt Web service for deployment, deploy the Web service to the ESREST enterprise server, and verify the deployment results.
Restriction: This topic applies only when the Enterprise Server feature is enabled.

Work through the following sections to prepare your project and Web service for deployment, and to deploy and verify.

Set Deployment Properties

To successfully deploy a REST Web service to an enterprise server instance, you need to first set some options that tell Visual COBOL the name of your enterprise server instance, and where to find certain files.

  1. From the COBOL Explorer, expand ProgramREST > Web Services
  2. Right-click the MakeCheckAppt Web service; then select Properties from the context menu.
  3. On the Deployment Server tab, click the Change button that corresponds to the Enterprise Server name field.
  4. In the Server column, click ESREST; then click OK.
  5. On the Application Files tab, click Legacy application needs deploying; then click Add Files to add the following files:
    Files Location Description

    appoint.dat

    consultants.dat

    customers.dat

    Your project's ProgramREST folder

    Data files accessed by the service

    schedule.dll

    Your project's New_Configuration.bin folder

    The executable file you need to debug the service

    These files are copied to the enterprise server when you deploy.

  6. Click OK.

Stop Enterprise Server Instances

To ensure that your enterprise server instance does not encounter any port conflicts with other enterprise server instances that use the same listener port, stop all started enterprise server instances as follows:

  1. If the Server Explorer in Visual COBOL is not active, click Window > Show View > Other > Micro Focus > Server Explorer; then click OK.
  2. From the Server Explorer, expand Local [localhost:86] to see a list of enterprise server instances.
  3. Right-click each started enterprise server instance, and stop it by selecting Stop from the context menu. Started enterprise server instances show with a green icon Started enterprise server instance.

Start the ESREST Enterprise Server Instance

Before deploying your service interface, you must start the ESREST instance that runs the MakeCheckAppt Web service.

  1. If the Server Explorer in Visual COBOL is not active, click Window > Show View > Other > Micro Focus > Server Explorer; then click OK.
  2. From the Server Explorer, expand Local [localhost:86] to see a list of available enterprise server instances.
  3. Right-click ESREST; then select Start from the context menu.
    Note: If this is the first time you have started the server you see a sign-on dialog box. If Server is secured is checked, uncheck it; then click OK. Unchecking Server is secured prevents this dialog box from showing when you subsequently start the region. If Server is secured is not checked, simply click OK to clear the dialog box.

The Enterprise Server Daemon is then invoked via the Console, starting the ESREST enterprise server instance.

Deploy the MakeCheckAppt Web Service

  1. From the COBOL Explorer, right-click the MakeCheckAppt Web Service; then click Deploy.
  2. In Eclipse, click the Console tab.
  3. On the icon bar, click the down arrow associated with Display Selected Console Display Selected Console.
  4. Click Service Interfaces Console.

The Console view shows the progression of the deployment process. If deployment was successful, you should see a message: Deployment completed with warnings. If you scroll up to see the log output, notice that the deployment process changed the direction of the slashes in some directory specifications. This is normal behavior for successful deployment.

Note: If the console switches to the Micro Focus Build view after deployment, switch the view back to Service Interfaces Console to review the deployment log.

If deployment ever fails, you should find a message in the Console view indicating why it failed. Also, the failure message contains the path to the deployment log file. You can type the address into a browser and view the log file from there.

View Deployment Results

Now that your service interface has been deployed as a service running on the ESREST enterprise server, you can look at the details of the deployed service via the Enterprise Server Administration page.

  1. If you have closed the Enterprise Server Administration window in Visual COBOL, start it again.

    In the row showing information for the ESREST enterprise server instance, you should see that the Objects column shows the number of services that this enterprise server instance runs.

  2. Click the Details button for the ESREST Services.

    In the row showing your new service, MakeCheckAppt, you'll notice that the Current Status column shows both operations as Available. This means that the service is ready to be accessed by a client.

  3. Close Enterprise Server Administration.