Request and response examples
- Last Updated: March 12, 2025
- 3 minute read
- Corticon
- Documentation
The various request and response types
A
B maps to A_B.A request must state which decision service to use. The major and minor version are optional. If you omit them, the decision service will assign the highest major and minor version that is found. If just the major version is declared, then the highest minor version of that major version is assigned.
SOAP and XML
The following examples are the output you get when you are editing a Ruletest. Click anywhere in the Input column, and then choose one of the Ruletest > Export options.<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<CorticonRequest xmlns="urn:Corticon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
decisionServiceName="InsertDecisionServiceName">
<WorkDocuments>While the corresponding XML header is
simply:<?xml version="1.0" encoding="UTF-8"?>
<CorticonRequest xmlns="urn:Corticon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
decisionServiceName="InsertDecisionServiceName">
<WorkDocuments>JSON
{
"__metadataRoot": {"#locale": ""},
"Objects": [
{
"volume": 10,
"container": null,
"weight": 1000,
"__metadata": {
"#type": "Cargo",
"#id": "Cargo_id_1"
}
},
{...}
}
],
"name": "InsertDecisionServiceName"
}That's not important in Ruletests, but when you try external requests it is vital. It need not be the name of the project or the Ruletest. You could name it Freight or Shipping. Just know that when you want that Decision Service, you need to use the name you assigned.
tutorial_example.erf, when you start the packaging process, it
looks like this:Rename the Decision Service to
Cargo:When you use the Web Console, you can see how various names and versions match up for comprehensive testing.
Native JSON
Native JSON adds another level of simplicity to JSON by leaving off the metadata altogether, and expecting that the request carries the parameters for at least the decision service name. For example, where the request carries the major and minor version:http://localhost/axis/corticon/execute/nativejson?
name=Cargo&majorVersion=7&minorVersion=242The request body can
then be very simple: {
"volume": 10,
"container": null,
"weight": 1000
}
But if you get too simple, the algorithm that tries to compensate for the strictness in
other formats can cause processing overhead. For example, if you have dozens of
entities, many with an attribute item, you could cause delays as the
algorithm discovers the right one by evaluating the other attributes. Try to keep
attribute names unique, or express the entity as __metadata in the
native JSON file.