A Corticon Server installation provides a JSON sample (similar to the SOAP .xml sample) and a test script that runs the sample.
Note: JSON datatypes require double-quotes only on String values. As JSON does not have a date datatype, Corticon treats time values as Strings. When the other datatypes -- Booleans and numbers -- are in quotes, Corticon interprets the datatype from its Vocabulary properties and removes the quotes. Output will conform to the JSON syntax.
The sample, located at [CORTICON_WORK_DIR]\Samples\Rule Projects\OrderProcessing\OrderProcessingPayload.json, is as follows:
2. Open a command prompt window at [CORTICON_HOME]\Server .NET\samples\bin.
3. Launch Corticon-Api-Rest-Test.exe. The command transaction list is displayed:
--------------------------------------------------------- --- Current Apache Axis Location: http://localhost:8850/axis ---------------------------------------------------------
Transactions: -1 - Exit REST API Test ------------------------------------------------------------------------------------ 0 - Change Connection Parameters ------------------------------------------------------------------------------------ 142 - Execute JSON REST request 143 - Execute JSON REST request (by specific Decision Service Major Version) 144 - Execute JSON REST request (by specific Decision Service Major and Minor Version) 145 - Execute JSON REST request (by specific execution Date) 146 - Execute JSON REST request (by specific execution Date and Decision Service Major Version) ------------------------------------------------------------------------------------ Enter transaction number
4. Enter 142.
5. When prompted for Input JSON File Path, enter the path to the sample:
6. When prompted for Input Decision Service Name, enter (or copy) the name of the Decision Service that is the sample's target:
ProcessOrder
The request is processed, and its output is placed at [CORTICON_WORK_DIR]\output with a name formatted as OutputCRString_{epochTime}.json where {epochTime} is the number of seconds that have elapsed since 1/1/1970. The input file is also placed there. The output for the sample is as follows: