AdresseLivraisonService :: 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": "Pays", "Operator": "0", "Value": "France" }, "Operator":0 } }
- orders
{"orders":[{"Id":"Asc"}]}
- pageNumber
{pageNumber: 1}
- rowsPerPage
{rowsPerPage: 10}
Example:
require (__DIR__ . '/service/Criteria.php'); use services\WebServices100; use services\Criteria; // add parameters $response = new Criteria(); $response->setType('CriteriaLogical:http://www.proconsult.lu/WebServices100'); $response->setFieldName('Pays'); $response->setOperator("0"); $response->setValue("France"); $response->setOperand( [ 'Operand1' => [ '__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100', 'FieldName' => 'Pays', 'Operator' => '0', 'Value' => 'France'] ] ); $url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/AdresseLivraisonService/rest/GetList'; $data = $response->getResponse(); // Send requests to receive data $result = WebServices100::getData($url, $data))); $response = json_decode($result);
Result:
Array ( [0] => stdClass Object ( [Id] => 1 [NumeroTiers] => BAGUES [IdModeExpedition] => 1 [IdConditionLivraison] => 1 [Intitule] => Bague's en or [Contact] => Mr Or [Adresse] => Rue tête dOr [Complement] => [CodePostal] => 57000 [Ville] => METZ [Region] => [Pays] => France [Telephone] => 06 65 87 00 00 [Fax] => 06 65 87 00 01 [Email] => [EstPrincipale] => 1 ) [1] => stdClass Object ( [Id] => 2 [NumeroTiers] => CARAT [IdModeExpedition] => 1 [IdConditionLivraison] => 1 [Intitule] => Annexe Sté Carat [Contact] => [Adresse] => 77, Rue du stade Mayol [Complement] => B.P. 83 [CodePostal] => 44595 [Ville] => St Herbain Cedex [Region] => [Pays] => France [Telephone] => 02 41 47 67 99 [Fax] => 02 41 47 67 95 [Email] => [EstPrincipale] => ) )