Previous Topic Next topic Print topic


Deploy a Service Interface

Walks you through the steps required to associate an enterprise server instance with your project, build the project, set deployment properties, deploy the service interface, and verify the deployment results.
Restriction: This topic applies only when the Enterprise Server feature is enabled.

To successfully deploy a REST service interface to an enterprise server instance, you need to first set some options in Visual COBOL.

Build the ProgramREST Project

You need to build the project to generate all required deployment files.

  • On the Solution Explorer, right-click the ProgramREST project; then click Build.

Set Deployment Properties

To ensure that the deployment process runs smoothly, you must set some options that tell Visual COBOL where to find certain files.

  1. From the Solution Explorer, right-click the ProgramREST service interface; then click Properties.
  2. Ensure that the interface type property is set to JSON Web Service (default).
  3. Click the Application files to deploy field, and then click its corresponding browse button Browse button 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 ProgramREST\bin\x86\Debug folder The executable file you need to debug the service.

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

  4. 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. From the Server Explorer, expand localhost under Micro Focus Servers to see a list of enterprise server instances.
  2. 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 where the ProgramREST service will run.

  1. From the Server Explorer, expand localhost under Micro Focus Servers to see a list of available enterprise server instances.
  2. To start the ESREST enterprise server instance, right-click it; then click Start.
    Note: If this is the first time you have started the server you see a sign-on dialog box. If Store Credentials is not selected, check it. Checking Store Credentials prevents this dialog box from showing by default when you subsequently start an enterprise server instance. Then click OK.

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

Build the ProgramREST Project

You need to generate a .dll executable file from your project to deploy with your service interface. This is necessary so that you can debug the service after generating a client.

  • From Solution Explorer, right-click the ProgramREST project; then select Build from the context menu.

Deploy the ProgramREST service interface

  • From the Solution Explorer, right-click the ProgramREST service interface; then click Deploy.

The Output window shows the progression of the deployment process. If deployment was successful, you should see a message indicating success.

If deployment ever fails, you should find a message in the Output window 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, you should see that the Objects column shows the number of services that this enterprise server instance runs. In this case, the number of running services should be at least 4. These are the two that come standard with the enterprise server, plus the one service you added containing two operations. You might see more if you have deployed other services to the ESREST enterprise server.

  2. Click the Details button for the ESREST Services.

    In the row showing your new service, ProgramREST, 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.
Previous Topic Next topic Print topic