Thunder Suite   •  JSON Thunder   •  XML Thunder   •  FAQs   •  Tutorials   •  Wiki   •  Levelset History   •  JSON Thunder Technical Details   •  XML Thunder Technical Details

Thunder Wiki for Thunder Suite, JSON Thunder & XML Thunder

Page History: Creating a JSON Handler from Schema Using JSON Thunder

Compare Page Revisions



Older Revision - Back to Page History - Newer Revision


Page Revision: 2015/06/19 11:43


CANAM-JSON-DATA – contains the program data fields. The Reader will return the parsed contents in these fields.

CANAM- JSON -BUFFER – contains the JSON message. The calling program will pass the JSON message to the reader in this structure.

CANAM- JSON -STATUS – contains the results of the call to the Reader. If JSON message is not valid, or if another error was encountered, an error code and additional error information will be returned in this structure.

Testing the JSON Writer:

To test your JSON Writer, compile the BAXSDWT and BAXSDW programs. The BAXSDWT (i.e. the Test Harness) is the main program. It calls the BAXSDW program (i.e. the JSON Writer). The copybook is not needed to test the Handler.

The Test Harness calls the JSON Writer from the CALL-TO-JSON-HANDLER paragraph. The call to a Writer looks identical to the call to a Reader.  The same three structures are always passed. The difference is which fields are populated before and after the call.    

Image




















CANAM-JSON-DATA – contains the program data fields. The Writer will return the parsed contents in these fields.

CANAM-JSON-BUFFER – contains the JSON message. The calling program will pass the JSON message to the reader in this structure.

CANAM-JSON-STATUS – contains the results of the call to the Writer. If an error was encountered, an error code and additional error information will be returned in this structure.

Summary

Using JSON Thunder, a developer is able to create a Handler Design that will define an JSON and a COBOL structure, the mappings between COBOL fields and JSON nodes within those structures, and the validation rules for content found in a given JSON instance. From the Handler Design, COBOL sub programs can be generated to Read and / or Write JSON instances. Optionally a COBOL copybook and Test Harness program can be generated.  The copybook contains the COBOL fields passed to and from the Handler and can be used by your calling program. The Test Harness provides an example of how to call a JSON Handler and can be used to quickly test your Handler and confirm it is performing as expected.  

If you have any questions or would like more information, please contact us at .