STREAM2WRK
The STREAM2WRK utility opens XML, JSON and WSDL files and generates the corresponding COBOL record description to be used by runtime classes like XMLStream, JSONStream and HTTPClient.
Usage 1 (JSON):
stream2wrk json jsonFile [-o outputfile] [-p prefix] [-d] [-r rootname] [-anyescape] |
Where:
• jsonFile is the name of the JSON file to parse. It can be either a disk file or a URL. Note that the utility is not able to read a file over the HTTPS protocol. In such case, the file should be downloaded to disc using third party utilities (e.g. a web browser) and then processed as a disc file.
• outputFile is the name of the file that will contain the record definition corresponding to jsonFile. If omitted, a file named jsonFile.wrk is created.
• prefix defines a string to be put in front of every data name in the record definition.
o When set to "0" or omitted, data-names are generated with no prefix.
o When set to "1", the prefix will be the name of the JSON file.
o Any other value represents the prefix to be used, without any conversion.
• -d activates or deactivates names ambiguity check
o When -d is omitted, field names are generated without control.
o When -d is used, field names are adapted if necessary in order to avoid ambiguous identifiers.
• When processing a JSON without root element or with an array as root element, Stream2Wrk generates a 01 level named "json2wrk". This name can be changed via -r command line option.
• -anyescape allows to process JSON streams that include backslashes among item values. Use this option if you encounter the error Internal error:org.xml.sax.SAXException: Unxpected character.
Usage 2 (WSDL):
stream2wrk wsdl wsdlFile [-o outputfile] [v1.1] |
Where:
• wsdlFile is the name of the WSDL file to parse. It can be either a disk file or a URL. Note that the utility is not able to read a file over the HTTPS protocol. In such case, the file should be downloaded to disc using third party utilities (e.g. a web browser) and then processed as a disc file.
• outputFile is the name of the file that will contain the record definition corresponding to wsdlFile. Multiple copy files are generated, one for each method described in the WSDL. The copy file is named by appending the method name to outputfile.
If outputfile is omitted, then the generated code is printed on the console.
• -v.1.1 should be used to process WSDL files of version 1.1. By default the utility expects WSDL files of version 2.0.
Usage 3 (XML):
stream2wrk xml xmlFile [-o outputfile] [-p prefix] [-d] |
Where:
• xmlFile is the name of the XML file to parse. It can be either a disk file or a URL. Note that the utility is not able to read a file over the HTTPS protocol. In such case, the file should be downloaded to disc using third party utilities (e.g. a web browser) and then processed as a disc file.
If the XML file includes a XSD, then the utility parses the XSD and the result is more accurate. If no XSD is available, then the utility guesses the fields characteristics according to the XML content.
• outputFile is the name of the file that will contain the record definition corresponding to xmlFile. If omitted, a file named xmlFile.wrk is created.
• prefix defines a string to be put in front of every data name in the record definition.
o When set to "0" or omitted, data-names are generated with no prefix.
o When set to "1", the prefix will be the name of the XML file.
o Any other value represents the prefix to be used, without any conversion.
• -d activates or deactivates names ambiguity check
o When -d is omitted, field names are generated without control.
o When -d is used, field names are adapted if necessary in order to avoid ambiguous identifiers.
Thin Client
STREAM2WRK can’t be launched directly by the isCOBOL Client.