1 | <?php |
||||
2 | /** |
||||
3 | * Composer autoload |
||||
4 | */ |
||||
5 | require_once __DIR__ . '/../vendor/autoload.php'; |
||||
6 | require_once __DIR__ . '/settings.inc.php'; |
||||
7 | /** |
||||
8 | * Used classes |
||||
9 | */ |
||||
10 | use WsdlToPhp\PackageBase\AbstractSoapClientBase; |
||||
11 | use ColissimoPickupPoint\ClassMap; |
||||
12 | use ColissimoPickupPoint\ServiceType\Find; |
||||
13 | use ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement; |
||||
14 | |||||
15 | /** |
||||
16 | * Minimal options |
||||
17 | */ |
||||
18 | $options = array( |
||||
19 | AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/pointretrait-ws-cxf/PointRetraitServiceWS/2.0?wsdl', |
||||
20 | AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get() |
||||
21 | ); |
||||
22 | /** |
||||
23 | * Samples for Find ServiceType |
||||
24 | */ |
||||
25 | $find = new Find($options); |
||||
26 | /** |
||||
27 | * Send the request |
||||
28 | */ |
||||
29 | $result = $find->findRDVPointRetraitAcheminement(new FindRDVPointRetraitAcheminement(COLISSIMO_WS_CONTRACT_NUMBER, COLISSIMO_WS_PASSWORD, '13 Rue de la Fédération', '75015', 'Paris', 'FR', '2', date('d/m/Y'))); |
||||
30 | /** |
||||
31 | * Debug informations provided by the utility methods |
||||
32 | */ |
||||
33 | if (true) { |
||||
34 | echo 'XML Request: ' . $find->getLastRequest() . "\r\n"; |
||||
35 | echo 'Headers Request: ' . $find->getLastRequestHeaders() . "\r\n"; |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
36 | echo 'XML Response: ' . $find->getLastResponse() . "\r\n"; |
||||
37 | echo 'Headers Response: ' . $find->getLastResponseHeaders() . "\r\n"; |
||||
0 ignored issues
–
show
Are you sure
$find->getLastResponseHeaders() of type null|string[] can be used in concatenation ?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
38 | } |
||||
39 | /** |
||||
40 | * Sample call for getProductInter operation/method |
||||
41 | */ |
||||
42 | if ($result !== false) { |
||||
0 ignored issues
–
show
|
|||||
43 | /** |
||||
44 | * @var ColissimoPickupPoint\StructType\RdvPointRetraitAcheminementResult |
||||
45 | */ |
||||
46 | $return = $result->getReturn(); |
||||
47 | echo PHP_EOL . sprintf('<br />ErrorCode: %s', $return->getErrorCode()); |
||||
48 | echo PHP_EOL . sprintf('<br />ErrorMessage: %s', $return->getErrorMessage()); |
||||
49 | echo PHP_EOL . sprintf('<br />Rdv: %s', $return->getRdv()); |
||||
50 | echo PHP_EOL . sprintf('<br />QualiteReponse: %s', $return->getQualiteReponse()); |
||||
51 | echo PHP_EOL . sprintf('<br />WsRequestId: %s', $return->getWsRequestId()); |
||||
52 | if ($return->getErrorCode() <= 0) { |
||||
53 | echo PHP_EOL . '<br />ListePointRetraitAcheminement'; |
||||
54 | foreach ($return->getListePointRetraitAcheminement() as $index => $pointRetraitAcheminement) { |
||||
55 | echo PHP_EOL . "\t" . sprintf('<br />Point retrait #%d', $index); |
||||
56 | echo PHP_EOL . "\t\t" . sprintf('<br />Distance %dm', $pointRetraitAcheminement->getDistanceEnMetre()); |
||||
57 | echo PHP_EOL . "\t\t" . sprintf('<br />Location %s, %s, %s, %s (%s)', |
||||
58 | $pointRetraitAcheminement->getNom(), |
||||
59 | $pointRetraitAcheminement->getAdresse1(), |
||||
60 | $pointRetraitAcheminement->getLocalite(), |
||||
61 | $pointRetraitAcheminement->getLibellePays(), |
||||
62 | $pointRetraitAcheminement->getIndiceDeLocalisation()); |
||||
63 | echo PHP_EOL . "\t\t" . sprintf("<br />Open hours \r\n\t\t\t<br />Monday: %s, \r\n\t\t\t<br />Tuesday: %s, \r\n\t\t\t<br />Wednesday: %s, \r\n\t\t\t<br />Thursday: %s \r\n\t\t\t<br />Friday: %s, \r\n\t\t\t<br />Saturday: %s, \r\n\t\t\t<br />Sunday: %s", |
||||
64 | $pointRetraitAcheminement->getHorairesOuvertureLundi(), |
||||
65 | $pointRetraitAcheminement->getHorairesOuvertureMardi(), |
||||
66 | $pointRetraitAcheminement->getHorairesOuvertureMercredi(), |
||||
67 | $pointRetraitAcheminement->getHorairesOuvertureJeudi(), |
||||
68 | $pointRetraitAcheminement->getHorairesOuvertureVendredi(), |
||||
69 | $pointRetraitAcheminement->getHorairesOuvertureSamedi(), |
||||
70 | $pointRetraitAcheminement->getHorairesOuvertureDimanche()); |
||||
71 | } |
||||
72 | } |
||||
73 | } else { |
||||
74 | echo PHP_EOL . 'An error occurred: ' . $find->getLastErrorForMethod('ColissimoPickupPoint\ServiceType\Find::findRDVPointRetraitAcheminement')->getMessage() . PHP_EOL; |
||||
75 | } |
||||
76 |