@@ -12,7 +12,6 @@ |
||
12 | 12 | use ColissimoPostage\StructType\GenerateLabelRequest; |
13 | 13 | use ColissimoPostage\StructType\OutputFormat; |
14 | 14 | use ColissimoPostage\StructType\Letter; |
15 | -use ColissimoPostage\StructType\Fields; |
|
16 | 15 | use ColissimoPostage\StructType\GenerateLabel; |
17 | 16 | use ColissimoPostage\StructType\Service; |
18 | 17 | use ColissimoPostage\StructType\Parcel; |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Composer autoload |
|
4 | - */ |
|
3 | + * Composer autoload |
|
4 | + */ |
|
5 | 5 | require_once __DIR__ . '/../vendor/autoload.php'; |
6 | 6 | /** |
7 | - * Used classes |
|
8 | - */ |
|
7 | + * Used classes |
|
8 | + */ |
|
9 | 9 | use WsdlToPhp\PackageBase\AbstractSoapClientBase; |
10 | 10 | use ColissimoPostage\ClassMap; |
11 | 11 | use ColissimoPostage\ServiceType\Generate; |
@@ -24,27 +24,27 @@ discard block |
||
24 | 24 | use ColissimoPostage\StructType\Address; |
25 | 25 | use ColissimoPostage\StructType\Addressee; |
26 | 26 | /** |
27 | - * Your Colissimo credentials |
|
28 | - */ |
|
27 | + * Your Colissimo credentials |
|
28 | + */ |
|
29 | 29 | define('COLISSIMO_WS_CONTRACT_NUMBER', '******'); |
30 | 30 | /** |
31 | - * Your Office 365 passowrd |
|
32 | - */ |
|
31 | + * Your Office 365 passowrd |
|
32 | + */ |
|
33 | 33 | define('COLISSIMO_WS_PASSWORD', '************'); |
34 | 34 | /** |
35 | - * Minimal options |
|
36 | - */ |
|
35 | + * Minimal options |
|
36 | + */ |
|
37 | 37 | $options = array( |
38 | 38 | AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', |
39 | 39 | AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get() |
40 | 40 | ); |
41 | 41 | /** |
42 | - * Samples for Generate ServiceType |
|
43 | - */ |
|
42 | + * Samples for Generate ServiceType |
|
43 | + */ |
|
44 | 44 | $generate = new Generate($options); |
45 | 45 | /** |
46 | - * Send the request |
|
47 | - */ |
|
46 | + * Send the request |
|
47 | + */ |
|
48 | 48 | $result = $generate->generateLabel( |
49 | 49 | new GenerateLabel( |
50 | 50 | new GenerateLabelRequest( |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | ) |
79 | 79 | ); |
80 | 80 | /** |
81 | - * Debug informations provided by the utility methods |
|
82 | - */ |
|
81 | + * Debug informations provided by the utility methods |
|
82 | + */ |
|
83 | 83 | if (true) { |
84 | 84 | echo 'XML Request: ' . $generate->getLastRequest() . "\r\n"; |
85 | 85 | echo 'Headers Request: ' . $generate->getLastRequestHeaders() . "\r\n"; |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | echo 'Headers Response: ' . $generate->getLastResponseHeaders() . "\r\n"; |
88 | 88 | } |
89 | 89 | /** |
90 | - * Sample call for getProductInter operation/method |
|
91 | - */ |
|
90 | + * Sample call for getProductInter operation/method |
|
91 | + */ |
|
92 | 92 | if ($generate->getLastResponse(true) instanceof \DOMDocument) { |
93 | 93 | echo PHP_EOL . 'PDF url: ' . $generate->getLastResponse(true) |
94 | 94 | ->getElementsByTagName('pdfUrl') |
@@ -1,65 +1,65 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file aims to show you how to use this generated package. |
|
4 | - * In addition, the goal is to show which methods are available and the fist needed parameter(s) |
|
5 | - * You have to use an associative array such as: |
|
6 | - * - the key must be a constant beginning with WSDL_ from AbstractSoapClientbase class each generated ServiceType class extends this class |
|
7 | - * - the value must be the corresponding key value (each option matches a {@link http://www.php.net/manual/en/soapclient.soapclient.php} option) |
|
8 | - * $options = array( |
|
9 | - * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', |
|
10 | - * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_TRACE => true, |
|
11 | - * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOGIN => 'you_secret_login', |
|
12 | - * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_PASSWORD => 'you_secret_password', |
|
13 | - * ); |
|
14 | - * etc.... |
|
15 | - */ |
|
3 | + * This file aims to show you how to use this generated package. |
|
4 | + * In addition, the goal is to show which methods are available and the fist needed parameter(s) |
|
5 | + * You have to use an associative array such as: |
|
6 | + * - the key must be a constant beginning with WSDL_ from AbstractSoapClientbase class each generated ServiceType class extends this class |
|
7 | + * - the value must be the corresponding key value (each option matches a {@link http://www.php.net/manual/en/soapclient.soapclient.php} option) |
|
8 | + * $options = array( |
|
9 | + * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', |
|
10 | + * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_TRACE => true, |
|
11 | + * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOGIN => 'you_secret_login', |
|
12 | + * \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_PASSWORD => 'you_secret_password', |
|
13 | + * ); |
|
14 | + * etc.... |
|
15 | + */ |
|
16 | 16 | require_once __DIR__ . '/vendor/autoload.php'; |
17 | 17 | /** |
18 | - * Minimal options |
|
19 | - */ |
|
18 | + * Minimal options |
|
19 | + */ |
|
20 | 20 | $options = array( |
21 | 21 | \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', |
22 | 22 | \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \ColissimoPostage\ClassMap::get(), |
23 | 23 | ); |
24 | 24 | /** |
25 | - * Samples for Generate ServiceType |
|
26 | - */ |
|
25 | + * Samples for Generate ServiceType |
|
26 | + */ |
|
27 | 27 | $generate = new \ColissimoPostage\ServiceType\Generate($options); |
28 | 28 | /** |
29 | - * Sample call for generateLabel operation/method |
|
30 | - */ |
|
29 | + * Sample call for generateLabel operation/method |
|
30 | + */ |
|
31 | 31 | if ($generate->generateLabel(new \ColissimoPostage\StructType\GenerateLabel()) !== false) { |
32 | 32 | print_r($generate->getResult()); |
33 | 33 | } else { |
34 | 34 | print_r($generate->getLastError()); |
35 | 35 | } |
36 | 36 | /** |
37 | - * Samples for Plan ServiceType |
|
38 | - */ |
|
37 | + * Samples for Plan ServiceType |
|
38 | + */ |
|
39 | 39 | $plan = new \ColissimoPostage\ServiceType\Plan($options); |
40 | 40 | /** |
41 | - * Sample call for planPickup operation/method |
|
42 | - */ |
|
41 | + * Sample call for planPickup operation/method |
|
42 | + */ |
|
43 | 43 | if ($plan->planPickup(new \ColissimoPostage\StructType\PlanPickup()) !== false) { |
44 | 44 | print_r($plan->getResult()); |
45 | 45 | } else { |
46 | 46 | print_r($plan->getLastError()); |
47 | 47 | } |
48 | 48 | /** |
49 | - * Samples for Get ServiceType |
|
50 | - */ |
|
49 | + * Samples for Get ServiceType |
|
50 | + */ |
|
51 | 51 | $get = new \ColissimoPostage\ServiceType\Get($options); |
52 | 52 | /** |
53 | - * Sample call for getListMailBoxPickingDates operation/method |
|
54 | - */ |
|
53 | + * Sample call for getListMailBoxPickingDates operation/method |
|
54 | + */ |
|
55 | 55 | if ($get->getListMailBoxPickingDates(new \ColissimoPostage\StructType\GetListMailBoxPickingDates()) !== false) { |
56 | 56 | print_r($get->getResult()); |
57 | 57 | } else { |
58 | 58 | print_r($get->getLastError()); |
59 | 59 | } |
60 | 60 | /** |
61 | - * Sample call for getProductInter operation/method |
|
62 | - */ |
|
61 | + * Sample call for getProductInter operation/method |
|
62 | + */ |
|
63 | 63 | if ($get->getProductInter(new \ColissimoPostage\StructType\GetProductInter()) !== false) { |
64 | 64 | print_r($get->getResult()); |
65 | 65 | } else { |
@@ -1,42 +1,42 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Composer autoload |
|
4 | - */ |
|
3 | + * Composer autoload |
|
4 | + */ |
|
5 | 5 | require_once __DIR__ . '/../vendor/autoload.php'; |
6 | 6 | /** |
7 | - * Used classes |
|
8 | - */ |
|
7 | + * Used classes |
|
8 | + */ |
|
9 | 9 | use WsdlToPhp\PackageBase\AbstractSoapClientBase; |
10 | 10 | use ColissimoPostage\ClassMap; |
11 | 11 | use ColissimoPostage\ServiceType\Get; |
12 | 12 | use ColissimoPostage\StructType\GetProductInter; |
13 | 13 | use ColissimoPostage\StructType\GetProductInterRequest; |
14 | 14 | /** |
15 | - * Your Colissimo credentials |
|
16 | - */ |
|
15 | + * Your Colissimo credentials |
|
16 | + */ |
|
17 | 17 | define('COLISSIMO_WS_CONTRACT_NUMBER', '******'); |
18 | 18 | /** |
19 | - * Your Office 365 passowrd |
|
20 | - */ |
|
19 | + * Your Office 365 passowrd |
|
20 | + */ |
|
21 | 21 | define('COLISSIMO_WS_PASSWORD', '************'); |
22 | 22 | /** |
23 | - * Minimal options |
|
24 | - */ |
|
23 | + * Minimal options |
|
24 | + */ |
|
25 | 25 | $options = array( |
26 | 26 | AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS?wsdl', |
27 | 27 | AbstractSoapClientBase::WSDL_CLASSMAP => ClassMap::get() |
28 | 28 | ); |
29 | 29 | /** |
30 | - * Samples for Get ServiceType |
|
31 | - */ |
|
30 | + * Samples for Get ServiceType |
|
31 | + */ |
|
32 | 32 | $get = new Get($options); |
33 | 33 | /** |
34 | - * Send the request |
|
35 | - */ |
|
34 | + * Send the request |
|
35 | + */ |
|
36 | 36 | $result = $get->getProductInter(new GetProductInter(new GetProductInterRequest(COLISSIMO_WS_CONTRACT_NUMBER, COLISSIMO_WS_PASSWORD, 'COLI', 0, 0, 1, 'DZ', '2000'))); |
37 | 37 | /** |
38 | - * Debug informations provided by the utility methods |
|
39 | - */ |
|
38 | + * Debug informations provided by the utility methods |
|
39 | + */ |
|
40 | 40 | if (false) { |
41 | 41 | echo 'XML Request: ' . $get->getLastRequest() . "\r\n"; |
42 | 42 | echo 'Headers Request: ' . $get->getLastRequestHeaders() . "\r\n"; |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | echo 'Headers Response: ' . $get->getLastResponseHeaders() . "\r\n"; |
45 | 45 | } |
46 | 46 | /** |
47 | - * Sample call for getProductInter operation/method |
|
48 | - */ |
|
47 | + * Sample call for getProductInter operation/method |
|
48 | + */ |
|
49 | 49 | if ($result !== false) { |
50 | 50 | echo sprintf('Product: %s', implode(',', $result->getReturn()->getProduct())) . PHP_EOL; |
51 | 51 | echo sprintf('PartnerType: %s', $result->getReturn()->getPartnerType()) . PHP_EOL; |