-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtutorial.php
More file actions
178 lines (176 loc) · 5.71 KB
/
Copy pathtutorial.php
File metadata and controls
178 lines (176 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/**
* This file aims to show you how to use this generated package.
* In addition, the goal is to show which methods are available and the first needed parameter(s)
* You have to use an associative array such as:
* - the key must be a constant beginning with WSDL_ from AbstractSoapClientBase class (each generated ServiceType class extends this class)
* - the value must be the corresponding key value (each option matches a {@link http://www.php.net/manual/en/soapclient.soapclient.php} option)
* $options = array(
* \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS/2.0?wsdl',
* \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_TRACE => true,
* \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_LOGIN => 'you_secret_login',
* \WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_PASSWORD => 'you_secret_password',
* );
* etc...
*/
require_once __DIR__ . '/vendor/autoload.php';
/**
* Colissimo
* Minimal options
*/
$options = array(
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/sls-ws/SlsServiceWS/2.0?wsdl',
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \Colissimo\ClassMap::get(),
);
/**
* Samples for Get ServiceType
*/
$get = new \Colissimo\ServiceType\Get($options);
/**
* Sample call for getListMailBoxPickingDates operation/method
*/
if ($get->getListMailBoxPickingDates(new \Colissimo\StructType\GetListMailBoxPickingDates()) !== false) {
print_r($get->getResult());
} else {
print_r($get->getLastError());
}
/**
* Sample call for getLabel operation/method
*/
if ($get->getLabel(new \Colissimo\StructType\GetLabel()) !== false) {
print_r($get->getResult());
} else {
print_r($get->getLastError());
}
/**
* Sample call for getProductInter operation/method
*/
if ($get->getProductInter(new \Colissimo\StructType\GetProductInter()) !== false) {
print_r($get->getResult());
} else {
print_r($get->getLastError());
}
/**
* Sample call for getBordereauByNumber operation/method
*/
if ($get->getBordereauByNumber(new \Colissimo\StructType\GetBordereauByNumber()) !== false) {
print_r($get->getResult());
} else {
print_r($get->getLastError());
}
/**
* Samples for Generate ServiceType
*/
$generate = new \Colissimo\ServiceType\Generate($options);
/**
* Sample call for generateLabel operation/method
*/
if ($generate->generateLabel(new \Colissimo\StructType\GenerateLabel()) !== false) {
print_r($generate->getResult());
} else {
print_r($generate->getLastError());
}
/**
* Sample call for generateToken operation/method
*/
if ($generate->generateToken(new \Colissimo\StructType\GenerateToken()) !== false) {
print_r($generate->getResult());
} else {
print_r($generate->getLastError());
}
/**
* Sample call for generateBordereauByParcelsNumbers operation/method
*/
if ($generate->generateBordereauByParcelsNumbers(new \Colissimo\StructType\GenerateBordereauByParcelsNumbers()) !== false) {
print_r($generate->getResult());
} else {
print_r($generate->getLastError());
}
/**
* Sample call for generateCN23 operation/method
*/
if ($generate->generateCN23(new \Colissimo\StructType\GenerateCN23()) !== false) {
print_r($generate->getResult());
} else {
print_r($generate->getLastError());
}
/**
* Samples for Plan ServiceType
*/
$plan = new \Colissimo\ServiceType\Plan($options);
/**
* Sample call for planPickup operation/method
*/
if ($plan->planPickup(new \Colissimo\StructType\PlanPickup()) !== false) {
print_r($plan->getResult());
} else {
print_r($plan->getLastError());
}
/**
* Samples for Check ServiceType
*/
$check = new \Colissimo\ServiceType\Check($options);
/**
* Sample call for checkGenerateLabel operation/method
*/
if ($check->checkGenerateLabel(new \Colissimo\StructType\CheckGenerateLabel()) !== false) {
print_r($check->getResult());
} else {
print_r($check->getLastError());
}
/**
* Colissimo Pickup Point
* Minimal options
*/
$options = array(
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://ws.colissimo.fr/pointretrait-ws-cxf/PointRetraitServiceWS/2.0?wsdl',
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \ColissimoPickupPoint\ClassMap::get(),
);
/**
* Samples for Find ServiceType
*/
$find = new \ColissimoPickupPoint\ServiceType\Find($options);
/**
* Sample call for findRDVPointRetraitAcheminement operation/method
*/
if ($find->findRDVPointRetraitAcheminement(new \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminement()) !== false) {
print_r($find->getResult());
} else {
print_r($find->getLastError());
}
/**
* Sample call for findRDVPointRetraitAcheminementByToken operation/method
*/
if ($find->findRDVPointRetraitAcheminementByToken(new \ColissimoPickupPoint\StructType\FindRDVPointRetraitAcheminementByToken()) !== false) {
print_r($find->getResult());
} else {
print_r($find->getLastError());
}
/**
* Sample call for findPointRetraitAcheminementByID operation/method
*/
if ($find->findPointRetraitAcheminementByID(new \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID()) !== false) {
print_r($find->getResult());
} else {
print_r($find->getLastError());
}
/**
* Colissimo Tracking
* Minimal options
*/
$options = array(
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_URL => 'https://www.coliposte.fr/tracking-chargeur-cxf/TrackingServiceWS?wsdl',
\WsdlToPhp\PackageBase\AbstractSoapClientBase::WSDL_CLASSMAP => \Colissimo\ClassMap::get(),
);
/**
* Samples for Track ServiceType
*/
$track = new \Colissimo\ServiceType\Track($options);
/**
* Sample call for track operation/method
*/
if ($track->track(new \Colissimo\StructType\Track()) !== false) {
print_r($track->getResult());
} else {
print_r($track->getLastError());
}