Set Up the JSONREQ Enterprise Server Region

Guides you through the process of creating the JSONREQ enterprise server region, and configuring JSONREQ resources, and installing and verifying those resources.

Start the Server Explorer

The Server Explorer view is visible by default when using the Team Developer perspective, and appears as a tab on the same level as the Application Explorer view. However, if it is not visible:

  • In Eclipse, click Window > Show View > Other > Micro Focus > Server Explorer, and then click Open.
Attention: You might encounter an ESCWA Sign On dialog box as you perform the steps required to create, configure, start, or stop an enterprise server instance from the Server Explorer. If you do, ensure that the Server requires credentials, Use specific server credentials, or Server is secured , and the Store credentials boxes are unchecked, and then click OK. Also, if prompted to disable password recovery, click No.

Create an enterprise server region

Here you use the Server Explorer to create an enterprise server region on which to run the requester Web service.

  1. On the Server Explorer, expand Local [localhost:10086] > Default [127.0.0.1:86]
  2. Right-click Default [127.0.0.1:86]; then select New > Enterprise Server.
  3. In the Name field, type JSONREQ.
  4. Click the Browse button that corresponds to the Template field, and navigate to the CICSWebServicesTemplate.xml file located in the InvokeReverseJSON project folder.
  5. Double-click CICSWebServicesTemplate.xml.
  6. On the list next to Associate with projects, check InvokeReverseJSON.
  7. Click Finish.

    The Server Explorer should now show the JSONREQ enterprise server region listed under Local [localhost:10086] > Default [127.0.0.1:86].

Configure JSONREQ resources

Start the JSONREQ enterprise server region
  • On the Server Explorer, right-click JSONREQ; then select Start.
Start Enterprise Server Common Web Administration (ESCWA)
  • On the Server Explorer, right-click Default [127.0.0.1:86] and then click Open Administration Page.

    ESCWA starts in your default browser.

Access the CICS resource settings for the server
  1. After JSONREQ has started, select it from the default Directory Servers list in ESCWA.
  2. At the top of the right pane, click CICS > Resources.
Create the JSONREQ resource group
  1. On the RESOURCES page, expand the Groups node.
  2. Click NEW in the GROUPS pane.
  3. In the Name field, type JSONREQ.
  4. In the Description field, type CICS Web Services JSON Requester Resources; then click SAVE. This invokes the JSONREQ page where you can create and define resources for the group.
Create resources
The invkRevJ program requires a URIMap resource, a pair of Bundle resources, and a PCT resource used to invoke the Reverse Web service from the Rumba+ TN3270 terminal emulator.
Define a URIMap resource
  1. On the JSONREQ page, click NEW and then click URIMap from the drop-down list.
    Important: If the Pipeline button is not present, check to be sure that you have properly installed the CCSID tables specified in the Tutorials: CICS Web Services topic.
  2. Complete these fields:
    Name REVRSURI
    Description URIMAP for JSON reverseJ request
    Usage Client
    Port 5482
    Host localhost
    Path /cics/services/json/reverse
  3. Click SAVE.
  4. Click BACK to return to the JSONREQ page.
Define Bundle resources
  1. On the JSONREQ page, click NEW and then select Bundle from the drop-down list.
  2. Complete these fields:
    Name REQBNDL
    Description Input bundle to map the data structure to a JSON request
    Bundle Directory $IDE_BUNDLE_LOC\REQBNDL
  3. Click SAVE.
  4. Click BACK to return to the JSONREQ page.
  5. Click NEW and then select Bundle from the drop-down list.
  6. Complete these fields:
    Name RESPBNDL
    Description Output bundle to map the JSON response to a data structure
    Bundle Directory $IDE_BUNDLE_LOC\RESPBNDL
  7. Click SAVE.
  8. Click BACK to return to the JSONREQ page.
Define a PCT resource
  1. On the JSONREQ page, click NEW and then select PCT from the drop-down list.
  2. Complete these fields:
    Name INVJ
    Description CWS transaction to invoke the reverse service
    Program Name invkRevJ
  3. Click SAVE.
Open the DEMOSTRT startup list
  1. Expand Startup Lists to see the list of CICS STARTUP LISTS.

    The JSONREQ region uses the default startup list, named DEMOSTRT.

  2. Click DEMOSTRT.

    This opens the DEMOSTRT page in the right pane.

Add resource groups to the startup list
As with the JSONPROV enterprise server region, the JSONREQ region requires the DFHWEB and DFHPIPE resource groups, and the new JSONREQ resource group containing the requester resources.
  1. On the DEMOSTRT page under GROUPS, click ADD.
  2. On the Available Groups list, check the DFHPIPE, DFHWEB, and JSONREQ groups.
  3. Click Select.

    This adds all groups to the end of the list.

  4. Cllick APPLY.

Install resources

You can install new and changed resources by stopping and starting the region.

  • From the Server Explorer in Eclipse , right-click JSONREQ; then select Restart. This stops and then starts the JSONREQ enterprise server region, automatically installing and loading the newly added resources on the startup list.

Verify Resources

After JSONREQ is started, you can verify that the resources you have defined are installed and active.

  1. From the ESCWA UI, click the JSONREQ server in default list.
  2. From the CICS drop-down list in the right pane, select Resources.
  3. Set the first field to the right of RESOURCES to Active.
  4. On the resulting list of active resources, click Bundle. You should see the REQBNDL and RESPBNDL bundles listed and marked as ENABLED.
  5. On the list, click URIMap > £map-ref, where map-ref is an alphanumeric string generated by Enterprise Server. You should see the path specified as /cics/services/json/reverse.

    Enterprise Server generates URIMAPs to provide CICS with the information it needs to process requests. The name of each generated URIMAP begins with a pounds sterling symbol (£).

    To run your provider CICS Web service, you send a JSON request to an endpoint URL that routes the request to your enterprise server region. The endpoint URL contains a URI value. The incoming request reads the installed URIMAPs to identify the map whose Path value matches the URI value of the endpoint URL. When the correct URIMAP is identified, CICS uses the data defined in the URIMAP, such as the name of the Web Service and its associated Pipeline, to process the request.

  6. Close ESCWA.