When calling services, it is possible to choose from a predefined list of call types:
- XML_HTTP
- JSON_GET
- JSON_POST
These are the default request and response structure for the above call types:
XML_HTTP Request:
<XML_HTTP_REQUEST> <FUNCTION NAME="FUNCTION1"> <INPUT> <PARAMETER1 VALUE="value of parameter1"/> <PARAMETER2 VALUE="value of parameter2"/> </INPUT> <TABLES> <FIELDS TABLE="TABLE1" FIELD="FIELD11" ROW="1" VALUE="value 111"/> <FIELDS TABLE="TABLE1" FIELD="FIELD11" ROW="2" VALUE="value 112"/> <FIELDS TABLE="TABLE2" FIELD="FIELD21" ROW="1" VALUE="value 221"/> <FIELDS TABLE="TABLE2" FIELD="FIELD22" ROW="1" VALUE="value 222"/> </TABLES> </FUNCTION> </XML_HTTP_REQUEST>
XML_HTTP Response:
<XML_HTTP> <XML_HTTP_RESPONSE> <RETURN_PARAMETERS> <RETURNPARAMETER1>retvalue1</RETURNPARAMETER1> <RETURNPARAMETER2>retvalue2</RETURNPARAMETER2> </RETURN_PARAMETERS> <TABLES> <TABLE1> <FIELD11>value 111</FIELD11> <FIELD12>value 112</FIELD12> </TABLE1> <TABLE1> <FIELD11>value 121</FIELD11> <FIELD12>value 122</FIELD12> </TABLE1> <TABLE2> <FIELD21>value 211</FIELD21> <FIELD22>value 212</FIELD22> <FIELD23>value 213</FIELD23> </TABLE2> </TABLES> </XML_HTTP_RESPONSE> </XML_HTTP>
JSON request and response:
{ "FunctionName":"TEST1", "Status":"", "StatusText":"", "TextEncoding":"", "SecurityToken":"", "Parameters":[ {"ParamName":"function_name", "ParamValue":"TEST1"}, {"ParamName":"requestencoding", "ParamValue":"UTF-8"}, {"ParamName":"responseencoding","ParamValue":"UTF-8"}, {"ParamName":"PARAM1","ParamValue":""}, {"ParamName":"PARAM2","ParamValue":"UID001"} ], "TableValues":[] }