The Server Explorer expandable ribbon is visible in Visual Studio on the top left side of the IDE by default when using Enterprise Developer. However, if it is not visible:
Here you use Enterprise Server to create an enterprise server region on which to run the Web service.
The Server Explorer should now show the CWSREST enterprise server region listed under localhost.
All Enterprise Server regions require access to certain resources, depending on the types of applications they run. Resources that are defined on a region's startup list are loaded during the startup routine, making them available for as long as the region is running.
CICS Web services use the underlying resources provided by the standard Enterprise Server CICS Web interface (CWI) and CICS Web Services (CWS) support. However, the CICSWebServicesTemplate used to create the CWSREST region does not include these resources on the startup list; therefore, you need to add them manually. The CWI resources reside in a predefined resource group named DFHWEB. The CWS resources are in the predefined DFHPIPE group.
In addition, you need to create and a resource group to contain the resources required by the BookREST program, and also add the new group to the startup list.
The ESCWA UI opens in a browser outside of the Visual Studio window.
As the region is starting, the Enterprise Server Administration Home page should show log information in the region's Status Log column. When the region is fully started, this is indicated in the region's Status column.
Name | RSTTCPIP |
Description | My TCP/IP Service |
Port No | 5639 |
Name | RESTPIPE | |
Description | My CICS Provider Pipeline | |
Response Wait Time | Check System Default | This is the number of seconds that an application waits for a response from the service. The default value 10 seconds for HTTP and 60 seconds for MQ. |
Config file | $IDE_XML_LOC\jsonjavaprovider.xml \ jsonjavaprovider.xml | The IDE_XML_LOC environment variable in CWSREST points to the xml project folder.1 |
Web Directory | $IDE_LOADLIB \ | The IDE_LOADLIB environment variable points to the loadlib project folder, which contains the WSBIND file.2 |
1 To see a list of environment variables defined for CWSRESTP, from the list of Directory Servers, click the (EDIT) button that corresponds to the CWSRESTP region. Click the downward arrow next to MONITOR at the top of the page, then click Environment Variables. 2The IDE_LOADLIB environment variable is set automatically when you start the enterprise server region from the Server Explorer in Visual Studio. |
The CWSREST region uses the default startup list, named DEMOSTRT.
This opens the DEMOSTRT page in the right pane.
This adds all groups to the end of the list.
You can install the new resources by stopping and starting the region.
This stops and then starts the CWSREST enterprise server region, automatically installing and loading the newly added resources on the startup list.
After CWSREST is started, you can verify that the resources you have defined are installed and active.
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.
To run your RESTful CICS Web service, you can either send an HTTP GET request to retrieve an existing book record or an HTTP PUT request to create a new book record. The request is sent 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.