4.6.2.2.9.4. Service Call Result

The result may be in JSON or XML, depending on the method call declaration. Currently, methods can return primitive data types, entities and entity collections.

Example of a JSON result:

Primitive data type:

{
  "result": "10"
}

Entity:

{
  "result": {
    "id" : "ref$Colour-b32e43e8-d4d9-11e2-8c8b-2b2939d67fff",
    "name": "Red"
  }
}
Example of XML result:

Primitive data type:

<result>
    10
</result>

Entity:

<result>
    <instance id="ref$Colour-b32a6412-d4d9-11e2-a20b-87b22b1460c7">
        <field name="name">Red</field>
    </instance>
</result>

The XSD of the result is available at http://schemas.haulmont.com/cuba/5.6/restapi-service-v2.xsd.