SqlService :: GetData

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:
  • string query (SQL),

Returns data.

Input parameters:

{
    "query":"SELECT DO_DATE AS CA_DATE,SUM(DO_TotalHT) AS CA_AMOUNT FROM F_DOCENTETE GROUP BY DO_DATE ORDER BY DO_DATE"
}

Example:

require (__DIR__ . '/service/WebServices100.php');

use services\WebServices100;

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/SqlService/rest/GetData';

// add parameters
$data = new stdClass();
$data->query = "SELECT DO_DATE AS CA_DATE,SUM(DO_TotalHT) AS CA_AMOUNT FROM F_DOCENTETE GROUP BY DO_DATE ORDER BY DO_DATE";

$json_data = json_encode($data);

// Send requests to receive data
$result = WebServices100::getData($url, $json_data);

// Transform the structure of the JSON returned to work in PHP
$response = $result;

Result:

"<\/xs:sequence><\/xs:complexType><\/xs:element><\/xs:choice><\/xs:complexType><\/xs:element><\/xs:schema>2015-01-02T00:00:00+03:00<\/CA_DATE>762.600000<\/CA_AMOUNT><\/DATA>2015-01-03T00:00:00+03:00<\/CA_DATE>935498.230000<\/CA_AMOUNT><\/DATA>2015-01-04T00:00:00+03:00<\/CA_DATE>4701.150000<\/CA_AMOUNT><\/DATA>2015-01-05T00:00:00+03:00<\/CA_DATE>13468.400000<\/CA_AMOUNT><\/DATA>2015-01-07T00:00:00+03:00<\/CA_DATE>641.250000<\/CA_AMOUNT><\/DATA>2015-01-08T00:00:00+03:00<\/CA_DATE>3619.000000<\/CA_AMOUNT><\/DATA>2015-01-09T00:00:00+03:00<\/CA_DATE>3696.000000<\/CA_AMOUNT><\/DATA>2015-01-10T00:00:00+03:00<\/CA_DATE>7267.420000<\/CA_AMOUNT><\/DATA>2015-01-11T00:00:00+03:00<\/CA_DATE>0.000000<\/CA_AMOUNT><\/DATA>2015-01-12T00:00:00+03:00<\/CA_DATE>8279.180000<\/CA_AMOUNT><\/DATA>2015-01-15T00:00:00+03:00<\/CA_DATE>40058.440000<\/CA_AMOUNT><\/DATA>2015-01-16T00:00:00+03:00<\/CA_DATE>5110.000000<\/CA_AMOUNT><\/DATA>2015-01-17T00:00:00+03:00<\/CA_DATE>10996.560000<\/CA_AMOUNT><\/DATA>2015-01-20T00:00:00+03:00<\/CA_DATE>15276.000000<\/CA_AMOUNT><\/DATA>2015-01-21T00:00:00+03:00<\/CA_DATE>5882.400000<\/CA_AMOUNT><\/DATA>2015-01-22T00:00:00+03:00<\/CA_DATE>824.400000<\/CA_AMOUNT><\/DATA>2015-01-23T00:00:00+03:00<\/CA_DATE>224.620000<\/CA_AMOUNT><\/DATA>2015-01-28T00:00:00+03:00<\/CA_DATE>26499.980000<\/CA_AMOUNT><\/DATA>2015-01-30T00:00:00+03:00<\/CA_DATE>1180.000000<\/CA_AMOUNT><\/DATA>2015-02-01T00:00:00+03:00<\/CA_DATE>1000.000000<\/CA_AMOUNT><\/DATA>2015-02-02T00:00:00+03:00<\/CA_DATE>59180.000000<\/CA_AMOUNT><\/DATA>2015-02-03T00:00:00+03:00<\/CA_DATE>134845.000000<\/CA_AMOUNT><\/DATA>2015-02-15T00:00:00+03:00<\/CA_DATE>1760.880000<\/CA_AMOUNT><\/DATA>2015-02-16T00:00:00+03:00<\/CA_DATE>1215.280000<\/CA_AMOUNT><\/DATA>2015-02-22T00:00:00+03:00<\/CA_DATE>6550.210000<\/CA_AMOUNT><\/DATA>2015-03-01T00:00:00+03:00<\/CA_DATE>1000.000000<\/CA_AMOUNT><\/DATA>2015-03-04T00:00:00+03:00<\/CA_DATE>2955.590000<\/CA_AMOUNT><\/DATA>2015-03-05T00:00:00+03:00<\/CA_DATE>3848.000000<\/CA_AMOUNT><\/DATA>2015-03-15T00:00:00+03:00<\/CA_DATE>0.000000<\/CA_AMOUNT><\/DATA>2015-03-18T00:00:00+03:00<\/CA_DATE>4692.290000<\/CA_AMOUNT><\/DATA><\/DocumentElement><\/diffgr:diffgram><\/DataTable>"