TaxeService :: GetList

The POST method, is used to retrieve data.

The list of parameters is not mandatory to request:

  • Criteria criteria,
  • array orders,
  • int pageNumber,
  • int rowsPerPage.

Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).

Input parameters:

  • Criteria
{"criteria":  
 {
  "__type":"CriteriaLogical:http://www.proconsult.lu/WebServices100",
  "Operand1": 
  {
   "__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
   "FieldName": "CodeTaxe",
   "Operator": "0",
   "Value": "RD1"
  }
  "Operator":0
 }
}
  • orders
{"orders":[{"Id":"Asc"}]}
  • pageNumber
{pageNumber: 1}
  • rowsPerPage
{rowsPerPage: 10}

Example:

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

use services\WebServices100;
use services\Criteria;

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

// add parameters
$response = new Criteria();
$response->setType('CriteriaLogical:http://www.proconsult.lu/WebServices100');
$response->setFieldName('CodeTaxe');
$response->setOperator("0");
$response->setValue("RD1");
$response->setOperand(
  [
    'Operand1' => [
    '__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100',
    'FieldName' => 'CodeTaxe',
    'Operator' => '0',
    'Value' => 'RD1']
    ]
);

$data = $response->getResponse();

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

$response_get = json_decode($result);

Result:

Array
(
    [0] => stdClass Object
        (
            [Id] => 1
            [CodeTaxe] => RD1
            [Intitule] => Contribution recyclage déchet 20 %
            [CodeRegroupement] => RD1
            [TypeTaux] => 2
            [TypeTaxe] => 2
            [Taux] => 0.4181
            [CompteGeneral] => 608820
            [SensTaxe] => 0
            [ProvenanceTaxe] => 0
            [EstNonPercue] => 
        )

    [1] => stdClass Object
        (
            [Id] => 2
            [CodeTaxe] => RC1
            [Intitule] => Contribution recyclage déchet 20 %
            [CodeRegroupement] => RC1
            [TypeTaux] => 2
            [TypeTaxe] => 2
            [Taux] => 0.4181
            [CompteGeneral] => 708820
            [SensTaxe] => 1
            [ProvenanceTaxe] => 0
            [EstNonPercue] => 
        )
)