Web Services interface
COBOL can provide or request Web Services, using architectures based on SOAP (Simple Object Access Protocol) or REST (REpresentational State Transfer). Data in the interface to such services is typically represented in JSON (JavaScript Object Notation) or XML (eXtensible Markup Language). The following information describes COBOL and other facilities that can be used to generate and consume JSON and XML.
Processing JSON input
You can process JSON text
input in a COBOL program by using the JSON PARSE statement. The statement
identifies the source data item containing the JSON text, and the
receiving data item that is populated by the parser.
In addition, the z/OS® Client Web Enablement Toolkit enables applications
to participate in the client/server space by providing a built-in z/OS JSON parser (
provided
with z/OS V2.2, or z/OS V2.1 with the PTF for APAR
OA46575 installed
) to consume JSON text from any source. Be aware
that this parser supports JSON texts in EBCDIC codepage 1047 only,
thus JSON text received by the application in another encoding format
must first be converted to EBCDIC 1047 before it can be input into
the parser.
For details, see the description
of the z/OS JSON parser in z/OS MVS™ Programming: Callable Services for High-Level Languages.