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
, 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 region 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.
- On the
Server Explorer, expand
Local [localhost:10086] > Default [127.0.0.1:86]
- Right-click
Default [127.0.0.1:86]; then select
New > Enterprise Server.
- In the
Name field, type
JSONREQ.
- Click the
Browse button that corresponds to the
Template field, and navigate to the
CICSWebServicesTemplate.xml file located in the
InvokeReverseJSON project folder.
- Double-click
CICSWebServicesTemplate.xml.
- On the list next to
Associate with projects, check
InvokeReverseJSON.
- 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)
-
- Access the CICS resource settings for the server
-
- After
JSONREQ has started, select it from the default
Directory Servers list in ESCWA.
- At the top of the right pane, open the drop-down menu next to
CICS.
- Create the JSONREQ resource group
-
- Click
By Groups next to
Resources in the
CICS menu.
- Click
Groups in the left-hand pane
- Click
NEW in the central
Groups pane.
- In the
Name field, type
JSONREQ.
- 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
HACloud TN3270 terminal emulator.
- Define a URIMap resource
-
- 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.
- Complete these fields:
Name
|
REVRSURI
|
Description
|
URIMAP for JSON reverseJ request
|
Usage
|
Client
|
Port
|
5482
|
Host
|
localhost
|
Path
|
/cics/services/json/reverse
|
- Click
SAVE.
- Click
BACK to return to the
JSONREQ page.
- Define Bundle resources
-
- On the
JSONREQ page, click
NEW and then select
Bundle from the drop-down list.
- Complete these fields:
Name
|
REQBNDL
|
Description
|
Input bundle to map the data structure to a JSON request
|
Bundle Directory
|
$IDE_BUNDLE_LOC\REQBNDL
|
- Click
SAVE.
- Click
BACK to return to the
JSONREQ page.
- Click
NEW and then select
Bundle from the drop-down list.
- Complete these fields:
Name
|
RESPBNDL
|
Description
|
Output bundle to map the JSON response to a data structure
|
Bundle Directory
|
$IDE_BUNDLE_LOC\RESPBNDL
|
- Click
SAVE.
- Click
BACK to return to the
JSONREQ page.
- Define a PCT resource
-
- On the
JSONREQ page, click
NEW and then select
PCT from the drop-down list.
- Complete these fields:
Name
|
INVJ
|
Description
|
CWS transaction to invoke the reverse service
|
Program Name
|
invkRevJ
|
- Click
SAVE.
- Open the DEMOSTRT startup list
-
- Expand
Startup Lists in the left-hand pane to see the list of the CICS startup lists.
The
JSONREQ region uses the default startup list, named DEMOSTRT.
- 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.
- On the
DEMOSTRT page under
Groups, click
Add.
- On the
Available Groups list, check the
DFHPIPE,
DFHWEB, and
JSONREQ groups.
- Click
Select.
This adds all groups to the end of the list.
- Click
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.
- From the ESCWA UI, click the
JSONREQ server in default list.
- From the
CICS drop-down list in the right pane, selectActive under
Resources.
- On the resulting list of active resources in the left pane, click
Bundle. You should see the
INVKRVJI and
INVKRVJO bundles listed and marked as
ENABLED.
- 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.
- Close ESCWA.