In order to develop a COBOL REST producer (server- side), to process requests and provide data, the COBOL program has to be transformed to be executed like a Web Service REST. This objective is achieved through the HTTPHandler class that allows communication with HTML pages through AJAX retrieving data and printing results.
• ISFUNCTION_GETZIP, a COBOL entry point that receives into isfunction-getZipCode working storage structure, a name of a US city and returns the zip code into isfunction-returnZipCode as JSON stream using displayJSON() method:
where isfunction-getZipCode working storage structure is defined like:
and isfunction-returnZipCode working storage structure is defined like:
• ISFUNCTION_GETCITY, a COBOL entry point that receives into isfunction-getCity working storage structure, a zip code of a US city and return the city name into isfunction-receivedCity variable as JSON stream using displayJSON() method:
where isfunction-getCity working storage structure is defined like:
and isfunction-receivedCity working storage structure is defined like:
| Copyright (c) 2017 Veryant |
| Contact us |
|
Please share your comments on this manual or on any Veryant product documentation with the email button at the top left |