Reconfigure and Redeploy the Service Interface

Restriction: This topic applies only when the Enterprise Server feature is enabled.

You need to reconfigure the ProgramCORS service interface to enable it to accept an AJAX request from any origin, and then redeploy it to your enterprise server instance. To prepare the ESCORS enterprise server instance to accept the redeployed service interface, you need to delete the previously deployed service.

Delete the Previously Deployed Service

  1. From the Server Explorer in Visual COBOL, right-click Micro Focus Servers; then click Administration.
  2. In the grid row for the ESCORS enterprise server instance, click the corresponding Edit button.
  3. At the top of the page, click the Services tab.
  4. In the grid row for your /temppath/ProgramCORS/1.0 service, click the corresponding Delete button.
  5. Click OK.

Set Deployment Properties

  1. From the Solution Explorer, right-click the ProgramCORS service interface; then click Properties.
  2. In the Allowed Origin field, type * (asterisk). This enables your enterprise server instance to accept all requests regardless of the origin.
  3. Save the project.

Deploy the ProgramCORS service interface

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

The Output window shows the progression of the deployment process.

View Deployment Results

Now that your service interface has once again been deployed as a service running on the ESCORS enterprise server instance, 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 ESCORS 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 ESCORS Services.

    In the row showing your service, ProgramCORS, you'll notice that the Current Status column shows all four operations as Available. This means that the service is ready to be accessed by a client. In addition, you should see that the Custom Configuration column for these operations now includes the following text"

    [response headers] Access-Control-Allow-Credentials=false Access-Control-Allow-Origin=*

    This indicates that your service is ready to be called by AJAX scripts.