1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Contains \jamesiarmes\PhpEws\Client. |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace jamesiarmes\PhpEws; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Base class of the Exchange Web Services application. |
10
|
|
|
* |
11
|
|
|
* @package php-ews\Client |
12
|
|
|
*/ |
13
|
|
|
class Client |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* Microsoft Exchange 2007 |
17
|
|
|
* |
18
|
|
|
* @var string |
19
|
|
|
*/ |
20
|
|
|
const VERSION_2007 = 'Exchange2007'; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* Microsoft Exchange 2007 SP1 |
24
|
|
|
* |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
const VERSION_2007_SP1 = 'Exchange2007_SP1'; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Microsoft Exchange 2007 SP2 |
31
|
|
|
* |
32
|
|
|
* @var string |
33
|
|
|
*/ |
34
|
|
|
const VERSION_2007_SP2 = 'Exchange2007_SP2'; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Microsoft Exchange 2007 SP3 |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
const VERSION_2007_SP3 = 'Exchange2007_SP3'; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Microsoft Exchange 2010 |
45
|
|
|
* |
46
|
|
|
* @var string |
47
|
|
|
*/ |
48
|
|
|
const VERSION_2010 = 'Exchange2010'; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* Microsoft Exchange 2010 SP1 |
52
|
|
|
* |
53
|
|
|
* @var string |
54
|
|
|
*/ |
55
|
|
|
const VERSION_2010_SP1 = 'Exchange2010_SP1'; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Microsoft Exchange 2010 SP2 |
59
|
|
|
* |
60
|
|
|
* @var string |
61
|
|
|
*/ |
62
|
|
|
const VERSION_2010_SP2 = 'Exchange2010_SP2'; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Microsoft Exchange 2013. |
66
|
|
|
* |
67
|
|
|
* @var string |
68
|
|
|
*/ |
69
|
|
|
const VERSION_2013 = 'Exchange2013'; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Microsoft Exchange 2013 SP1. |
73
|
|
|
* |
74
|
|
|
* @var string |
75
|
|
|
*/ |
76
|
|
|
const VERSION_2013_SP1 = 'Exchange2013_SP1'; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Microsoft Exchange 2016. |
80
|
|
|
* |
81
|
|
|
* @var string |
82
|
|
|
*/ |
83
|
|
|
const VERSION_2016 = 'Exchange2016'; |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Password to use when connecting to the Exchange server. |
87
|
|
|
* |
88
|
|
|
* @var string |
89
|
|
|
*/ |
90
|
|
|
protected $password; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* Location of the Exchange server. |
94
|
|
|
* |
95
|
|
|
* @var string |
96
|
|
|
*/ |
97
|
|
|
protected $server; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* SOAP client used to make the request |
101
|
|
|
* |
102
|
|
|
* @var \jamesiarmes\PhpEws\SoapClient |
103
|
|
|
*/ |
104
|
|
|
protected $soap; |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Username to use when connecting to the Exchange server. |
108
|
|
|
* |
109
|
|
|
* @var string |
110
|
|
|
*/ |
111
|
|
|
protected $username; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Exchange impersonation |
115
|
|
|
* |
116
|
|
|
* @var \jamesiarmes\PhpEws\Type\ExchangeImpersonationType |
117
|
|
|
*/ |
118
|
|
|
protected $impersonation; |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* Miscrosoft Exchange version that we are going to connect to |
122
|
|
|
* |
123
|
|
|
* @var string |
124
|
|
|
* |
125
|
|
|
* @see Client::VERSION_2007 |
126
|
|
|
* @see Client::VERSION_2007_SP1 |
127
|
|
|
* @see Client::VERSION_2007_SP2 |
128
|
|
|
* @see Client::VERSION_2007_SP3 |
129
|
|
|
* @see Client::VERSION_2010 |
130
|
|
|
* @see Client::VERSION_2010_SP1 |
131
|
|
|
* @see Client::VERSION_2010_SP2 |
132
|
|
|
*/ |
133
|
|
|
protected $version; |
134
|
|
|
|
135
|
|
|
/** |
136
|
|
|
* Constructor for the ExchangeWebServices class |
137
|
|
|
* |
138
|
|
|
* @param string $server |
139
|
|
|
* @param string $username |
140
|
|
|
* @param string $password |
141
|
|
|
* @param string $version One of the Client::VERSION_* constants. |
142
|
|
|
*/ |
143
|
|
|
public function __construct( |
144
|
|
|
$server = null, |
145
|
|
|
$username = null, |
146
|
|
|
$password = null, |
147
|
|
|
$version = self::VERSION_2007 |
148
|
|
|
) { |
149
|
|
|
// Set the object properties. |
150
|
|
|
$this->setServer($server); |
151
|
|
|
$this->setUsername($username); |
152
|
|
|
$this->setPassword($password); |
153
|
|
|
$this->setVersion($version); |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* Returns the SOAP Client that may be used to make calls against the server |
158
|
|
|
* |
159
|
|
|
* @return \jamesiarmes\PhpEws\SoapClient |
160
|
|
|
*/ |
161
|
|
|
public function getClient() |
162
|
|
|
{ |
163
|
|
|
return $this->initializeSoapClient(); |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
/** |
167
|
|
|
* Sets the impersonation property |
168
|
|
|
* |
169
|
|
|
* @param \jamesiarmes\PhpEws\Type\ExchangeImpersonationType $impersonation |
170
|
|
|
*/ |
171
|
|
|
public function setImpersonation($impersonation) |
172
|
|
|
{ |
173
|
|
|
$this->impersonation = $impersonation; |
174
|
|
|
|
175
|
|
|
return true; |
176
|
|
|
} |
177
|
|
|
|
178
|
|
|
/** |
179
|
|
|
* Sets the password property |
180
|
|
|
* |
181
|
|
|
* @param string $password |
182
|
|
|
*/ |
183
|
|
|
public function setPassword($password) |
184
|
|
|
{ |
185
|
|
|
$this->password = $password; |
186
|
|
|
|
187
|
|
|
return true; |
188
|
|
|
} |
189
|
|
|
|
190
|
|
|
/** |
191
|
|
|
* Sets the server property |
192
|
|
|
* |
193
|
|
|
* @param string $server |
194
|
|
|
*/ |
195
|
|
|
public function setServer($server) |
196
|
|
|
{ |
197
|
|
|
$this->server = $server; |
198
|
|
|
|
199
|
|
|
return true; |
200
|
|
|
} |
201
|
|
|
|
202
|
|
|
/** |
203
|
|
|
* Sets the user name property |
204
|
|
|
* |
205
|
|
|
* @param string $username |
206
|
|
|
*/ |
207
|
|
|
public function setUsername($username) |
208
|
|
|
{ |
209
|
|
|
$this->username = $username; |
210
|
|
|
|
211
|
|
|
return true; |
212
|
|
|
} |
213
|
|
|
|
214
|
|
|
/** |
215
|
|
|
* Sets the version property |
216
|
|
|
* |
217
|
|
|
* @param string $version |
218
|
|
|
*/ |
219
|
|
|
public function setVersion($version) |
220
|
|
|
{ |
221
|
|
|
$this->version = $version; |
222
|
|
|
|
223
|
|
|
return true; |
224
|
|
|
} |
225
|
|
|
|
226
|
|
|
/** |
227
|
|
|
* Function Description |
228
|
|
|
* |
229
|
|
|
* @param \jamesiarmes\PhpEws\Request\AddDelegateType $request |
230
|
|
|
* @return \jamesiarmes\PhpEws\Response\AddDelegateResponseMessageType |
231
|
|
|
*/ |
232
|
|
|
public function AddDelegate($request) |
233
|
|
|
{ |
234
|
|
|
$this->initializeSoapClient(); |
235
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
236
|
|
|
|
237
|
|
|
return $this->processResponse($response); |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* Adds a distribution group to the instant messaging (IM) list in the |
242
|
|
|
* Unified Contact Store. |
243
|
|
|
* |
244
|
|
|
* @param \jamesiarmes\PhpEws\Request\AddDistributionGroupToImListType $request |
245
|
|
|
* @return \jamesiarmes\PhpEws\Response\AddDistributionGroupToImListResponseMessageType |
246
|
|
|
* |
247
|
|
|
* @since Exchange 2013 |
248
|
|
|
*/ |
249
|
|
|
public function AddDistributionGroupToImList($request) |
250
|
|
|
{ |
251
|
|
|
$this->initializeSoapClient(); |
252
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
253
|
|
|
|
254
|
|
|
return $this->processResponse($response); |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* Adds an existing instant messaging (IM) contact to a group. |
259
|
|
|
* |
260
|
|
|
* @param \jamesiarmes\PhpEws\Request\AddImContactToGroup $request |
261
|
|
|
* @return \jamesiarmes\PhpEws\Response\AddImContactToGroupResponseMessageType |
262
|
|
|
* |
263
|
|
|
* @since Exchange 2013 |
264
|
|
|
*/ |
265
|
|
|
public function AddImContactToGroup($request) |
266
|
|
|
{ |
267
|
|
|
$this->initializeSoapClient(); |
268
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
269
|
|
|
|
270
|
|
|
return $this->processResponse($response); |
271
|
|
|
} |
272
|
|
|
|
273
|
|
|
/** |
274
|
|
|
* Adds a new instant messaging (IM) group to a mailbox. |
275
|
|
|
* |
276
|
|
|
* @param \jamesiarmes\PhpEws\Request\AddImGroupType $request |
277
|
|
|
* @return \jamesiarmes\PhpEws\Response\AddImGroupResponseMessageType |
278
|
|
|
* |
279
|
|
|
* @since Exchange 2013 |
280
|
|
|
*/ |
281
|
|
|
public function AddImGroup($request) |
282
|
|
|
{ |
283
|
|
|
$this->initializeSoapClient(); |
284
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
285
|
|
|
|
286
|
|
|
return $this->processResponse($response); |
287
|
|
|
} |
288
|
|
|
|
289
|
|
|
/** |
290
|
|
|
* Adds a new contact to an instant messaging (IM) group. |
291
|
|
|
* |
292
|
|
|
* @since Exchange 2013 |
293
|
|
|
* |
294
|
|
|
* @param \jamesiarmes\PhpEws\Request\AddNewImContactToGroup $request |
295
|
|
|
* @return \jamesiarmes\PhpEws\Response\AddNewImContactToGroupResponseMessageType |
296
|
|
|
*/ |
297
|
|
|
public function AddNewImContactToGroup($request) |
298
|
|
|
{ |
299
|
|
|
$this->initializeSoapClient(); |
300
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
301
|
|
|
|
302
|
|
|
return $this->processResponse($response); |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* Function Description |
307
|
|
|
* |
308
|
|
|
* @param \jamesiarmes\PhpEws\Request\ConvertIdType $request |
309
|
|
|
* @return \jamesiarmes\PhpEws\Response\ConvertIdResponseType |
310
|
|
|
*/ |
311
|
|
|
public function ConvertId($request) |
312
|
|
|
{ |
313
|
|
|
$this->initializeSoapClient(); |
314
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
315
|
|
|
|
316
|
|
|
return $this->processResponse($response); |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* Function Description |
321
|
|
|
* |
322
|
|
|
* @param \jamesiarmes\PhpEws\Request\CopyFolderType $request |
323
|
|
|
* @return \jamesiarmes\PhpEws\Response\CopyFolderResponseType |
324
|
|
|
*/ |
325
|
|
|
public function CopyFolder($request) |
326
|
|
|
{ |
327
|
|
|
$this->initializeSoapClient(); |
328
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
329
|
|
|
|
330
|
|
|
return $this->processResponse($response); |
331
|
|
|
} |
332
|
|
|
|
333
|
|
|
/** |
334
|
|
|
* Function Description |
335
|
|
|
* |
336
|
|
|
* @param \jamesiarmes\PhpEws\Request\CopyItemType $request |
337
|
|
|
* @return \jamesiarmes\PhpEws\Response\CopyItemResponseType |
338
|
|
|
*/ |
339
|
|
|
public function CopyItem($request) |
340
|
|
|
{ |
341
|
|
|
$this->initializeSoapClient(); |
342
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
343
|
|
|
|
344
|
|
|
return $this->processResponse($response); |
345
|
|
|
} |
346
|
|
|
|
347
|
|
|
/** |
348
|
|
|
* Function Description |
349
|
|
|
* |
350
|
|
|
* @param \jamesiarmes\PhpEws\Request\CreateAttachmentType $request |
351
|
|
|
* @return \jamesiarmes\PhpEws\Response\CreateAttachmentResponseType |
352
|
|
|
*/ |
353
|
|
|
public function CreateAttachment($request) |
354
|
|
|
{ |
355
|
|
|
$this->initializeSoapClient(); |
356
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
357
|
|
|
|
358
|
|
|
return $this->processResponse($response); |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
/** |
362
|
|
|
* Function Description |
363
|
|
|
* |
364
|
|
|
* @param \jamesiarmes\PhpEws\Request\CreateFolderType $request |
365
|
|
|
* @return \jamesiarmes\PhpEws\Response\CreateFolderResponseType |
366
|
|
|
*/ |
367
|
|
|
public function CreateFolder($request) |
368
|
|
|
{ |
369
|
|
|
$this->initializeSoapClient(); |
370
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
371
|
|
|
|
372
|
|
|
return $this->processResponse($response); |
373
|
|
|
} |
374
|
|
|
|
375
|
|
|
/** |
376
|
|
|
* Function Description |
377
|
|
|
* |
378
|
|
|
* @param \jamesiarmes\PhpEws\Request\CreateItemType $request |
379
|
|
|
* @return \jamesiarmes\PhpEws\Response\CreateItemResponseType |
380
|
|
|
*/ |
381
|
|
|
public function CreateItem($request) |
382
|
|
|
{ |
383
|
|
|
$this->initializeSoapClient(); |
384
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
385
|
|
|
|
386
|
|
|
return $this->processResponse($response); |
387
|
|
|
} |
388
|
|
|
|
389
|
|
|
/** |
390
|
|
|
* Function Description |
391
|
|
|
* |
392
|
|
|
* @param \jamesiarmes\PhpEws\Request\CreateManagedFolderRequestType $request |
393
|
|
|
* @return \jamesiarmes\PhpEws\Response\CreateManagedFolderResponseType |
394
|
|
|
*/ |
395
|
|
|
public function CreateManagedFolder($request) |
396
|
|
|
{ |
397
|
|
|
$this->initializeSoapClient(); |
398
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
399
|
|
|
|
400
|
|
|
return $this->processResponse($response); |
401
|
|
|
} |
402
|
|
|
|
403
|
|
|
/** |
404
|
|
|
* Function Description |
405
|
|
|
* |
406
|
|
|
* @param \jamesiarmes\PhpEws\Request\DeleteAttachmentType $request |
407
|
|
|
* @return \jamesiarmes\PhpEws\Response\DeleteAttachmentResponseType |
408
|
|
|
*/ |
409
|
|
|
public function DeleteAttachment($request) |
410
|
|
|
{ |
411
|
|
|
$this->initializeSoapClient(); |
412
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
413
|
|
|
|
414
|
|
|
return $this->processResponse($response); |
415
|
|
|
} |
416
|
|
|
|
417
|
|
|
/** |
418
|
|
|
* Function Description |
419
|
|
|
* |
420
|
|
|
* @param \jamesiarmes\PhpEws\Request\DeleteFolderType $request |
421
|
|
|
* @return \jamesiarmes\PhpEws\Response\DeleteFolderResponseType |
422
|
|
|
*/ |
423
|
|
|
public function DeleteFolder($request) |
424
|
|
|
{ |
425
|
|
|
$this->initializeSoapClient(); |
426
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
427
|
|
|
|
428
|
|
|
return $this->processResponse($response); |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
/** |
432
|
|
|
* Function Description |
433
|
|
|
* |
434
|
|
|
* @param \jamesiarmes\PhpEws\Request\DeleteItemType $request |
435
|
|
|
* @return \jamesiarmes\PhpEws\Response\DeleteItemResponseType |
436
|
|
|
*/ |
437
|
|
|
public function DeleteItem($request) |
438
|
|
|
{ |
439
|
|
|
$this->initializeSoapClient(); |
440
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
441
|
|
|
|
442
|
|
|
return $this->processResponse($response); |
443
|
|
|
} |
444
|
|
|
|
445
|
|
|
/** |
446
|
|
|
* Function Description |
447
|
|
|
* |
448
|
|
|
* @param \jamesiarmes\PhpEws\Request\ExpandDLType $request |
449
|
|
|
* @return \jamesiarmes\PhpEws\Response\ExpandDLResponseType |
450
|
|
|
*/ |
451
|
|
|
public function ExpandDL($request) |
452
|
|
|
{ |
453
|
|
|
$this->initializeSoapClient(); |
454
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
455
|
|
|
|
456
|
|
|
return $this->processResponse($response); |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
/** |
460
|
|
|
* Function Description |
461
|
|
|
* |
462
|
|
|
* @param \jamesiarmes\PhpEws\Request\FindFolderType $request |
463
|
|
|
* @return \jamesiarmes\PhpEws\Response\FindFolderResponseType |
464
|
|
|
*/ |
465
|
|
|
public function FindFolder($request) |
466
|
|
|
{ |
467
|
|
|
$this->initializeSoapClient(); |
468
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
469
|
|
|
|
470
|
|
|
return $this->processResponse($response); |
471
|
|
|
} |
472
|
|
|
|
473
|
|
|
/** |
474
|
|
|
* Function Description |
475
|
|
|
* |
476
|
|
|
* @param \jamesiarmes\PhpEws\Request\FindItemType $request |
477
|
|
|
* @return \jamesiarmes\PhpEws\Response\FindItemResponseType |
478
|
|
|
*/ |
479
|
|
|
public function FindItem($request) |
480
|
|
|
{ |
481
|
|
|
$this->initializeSoapClient(); |
482
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
483
|
|
|
|
484
|
|
|
return $this->processResponse($response); |
485
|
|
|
} |
486
|
|
|
|
487
|
|
|
/** |
488
|
|
|
* Function Description |
489
|
|
|
* |
490
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetAttachmentType $request |
491
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetAttachmentResponseType |
492
|
|
|
*/ |
493
|
|
|
public function GetAttachment($request) |
494
|
|
|
{ |
495
|
|
|
$this->initializeSoapClient(); |
496
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
497
|
|
|
|
498
|
|
|
return $this->processResponse($response); |
499
|
|
|
} |
500
|
|
|
|
501
|
|
|
/** |
502
|
|
|
* Function Description |
503
|
|
|
* |
504
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetDelegateType $request |
505
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetDelegateResponseMessageType |
506
|
|
|
*/ |
507
|
|
|
public function GetDelegate($request) |
508
|
|
|
{ |
509
|
|
|
$this->initializeSoapClient(); |
510
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
511
|
|
|
|
512
|
|
|
return $this->processResponse($response); |
513
|
|
|
} |
514
|
|
|
|
515
|
|
|
/** |
516
|
|
|
* Function Description |
517
|
|
|
* |
518
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetEventsType $request |
519
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetEventsResponseType |
520
|
|
|
*/ |
521
|
|
|
public function GetEvents($request) |
522
|
|
|
{ |
523
|
|
|
$this->initializeSoapClient(); |
524
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
525
|
|
|
|
526
|
|
|
return $this->processResponse($response); |
527
|
|
|
} |
528
|
|
|
|
529
|
|
|
/** |
530
|
|
|
* Function Description |
531
|
|
|
* |
532
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetFolderType $request |
533
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetFolderResponseType |
534
|
|
|
*/ |
535
|
|
|
public function GetFolder($request) |
536
|
|
|
{ |
537
|
|
|
$this->initializeSoapClient(); |
538
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
539
|
|
|
|
540
|
|
|
return $this->processResponse($response); |
541
|
|
|
} |
542
|
|
|
|
543
|
|
|
/** |
544
|
|
|
* Function Description |
545
|
|
|
* |
546
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetItemType $request |
547
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetItemResponseType |
548
|
|
|
*/ |
549
|
|
|
public function GetItem($request) |
550
|
|
|
{ |
551
|
|
|
$this->initializeSoapClient(); |
552
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
553
|
|
|
|
554
|
|
|
return $this->processResponse($response); |
555
|
|
|
} |
556
|
|
|
|
557
|
|
|
/** |
558
|
|
|
* Retrieve the timezones supported by the server. |
559
|
|
|
* |
560
|
|
|
* @since Exchange 2010 |
561
|
|
|
* |
562
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetServerTimeZonesType $request |
563
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetServerTimeZonesResponseType |
564
|
|
|
*/ |
565
|
|
|
public function GetServerTimeZones($request) |
566
|
|
|
{ |
567
|
|
|
$this->initializeSoapClient(); |
568
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
569
|
|
|
|
570
|
|
|
return $this->processResponse($response); |
571
|
|
|
} |
572
|
|
|
|
573
|
|
|
/** |
574
|
|
|
* Function Description |
575
|
|
|
* |
576
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetUserAvailabilityRequestType $request |
577
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetUserAvailabilityResponseType |
578
|
|
|
*/ |
579
|
|
|
public function GetUserAvailability($request) |
580
|
|
|
{ |
581
|
|
|
$this->initializeSoapClient(); |
582
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
583
|
|
|
|
584
|
|
|
return $this->processResponse($response); |
585
|
|
|
} |
586
|
|
|
|
587
|
|
|
/** |
588
|
|
|
* Function Description |
589
|
|
|
* |
590
|
|
|
* @param \jamesiarmes\PhpEws\Request\GetUserOofSettingsRequest $request |
591
|
|
|
* @return \jamesiarmes\PhpEws\Response\GetUserOofSettingsResponse |
592
|
|
|
*/ |
593
|
|
|
public function GetUserOofSettings($request) |
594
|
|
|
{ |
595
|
|
|
$this->initializeSoapClient(); |
596
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
597
|
|
|
|
598
|
|
|
return $this->processResponse($response); |
599
|
|
|
} |
600
|
|
|
|
601
|
|
|
/** |
602
|
|
|
* Function Description |
603
|
|
|
* |
604
|
|
|
* @param \jamesiarmes\PhpEws\Request\MoveFolderType $request |
605
|
|
|
* @return \jamesiarmes\PhpEws\Response\MoveFolderResponseType |
606
|
|
|
*/ |
607
|
|
|
public function MoveFolder($request) |
608
|
|
|
{ |
609
|
|
|
$this->initializeSoapClient(); |
610
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
611
|
|
|
|
612
|
|
|
return $this->processResponse($response); |
613
|
|
|
} |
614
|
|
|
|
615
|
|
|
/** |
616
|
|
|
* Function Description |
617
|
|
|
* |
618
|
|
|
* @param \jamesiarmes\PhpEws\Request\MoveItemType $request |
619
|
|
|
* @return \jamesiarmes\PhpEws\Response\MoveItemResponseType |
620
|
|
|
*/ |
621
|
|
|
public function MoveItem($request) |
622
|
|
|
{ |
623
|
|
|
$this->initializeSoapClient(); |
624
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
625
|
|
|
|
626
|
|
|
return $this->processResponse($response); |
627
|
|
|
} |
628
|
|
|
|
629
|
|
|
/** |
630
|
|
|
* Function Description |
631
|
|
|
* |
632
|
|
|
* @param \jamesiarmes\PhpEws\Request\RemoveDelegateType $request |
633
|
|
|
* @return \jamesiarmes\PhpEws\Response\RemoveDelegateResponseMessageType |
634
|
|
|
*/ |
635
|
|
|
public function RemoveDelegate($request) |
636
|
|
|
{ |
637
|
|
|
$this->initializeSoapClient(); |
638
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
639
|
|
|
|
640
|
|
|
return $this->processResponse($response); |
641
|
|
|
} |
642
|
|
|
|
643
|
|
|
/** |
644
|
|
|
* Function Description |
645
|
|
|
* |
646
|
|
|
* @param \jamesiarmes\PhpEws\Request\ResolveNamesType $request |
647
|
|
|
* @return \jamesiarmes\PhpEws\Response\ResolveNamesResponseType |
648
|
|
|
*/ |
649
|
|
|
public function ResolveNames($request) |
650
|
|
|
{ |
651
|
|
|
$this->initializeSoapClient(); |
652
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
653
|
|
|
|
654
|
|
|
return $this->processResponse($response); |
655
|
|
|
} |
656
|
|
|
|
657
|
|
|
/** |
658
|
|
|
* Function Description |
659
|
|
|
* |
660
|
|
|
* @param \jamesiarmes\PhpEws\Request\SendItemType $request |
661
|
|
|
* @return \jamesiarmes\PhpEws\Response\SendItemResponseType |
662
|
|
|
*/ |
663
|
|
|
public function SendItem($request) |
664
|
|
|
{ |
665
|
|
|
$this->initializeSoapClient(); |
666
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
667
|
|
|
|
668
|
|
|
return $this->processResponse($response); |
669
|
|
|
} |
670
|
|
|
|
671
|
|
|
/** |
672
|
|
|
* Function Description |
673
|
|
|
* |
674
|
|
|
* @param \jamesiarmes\PhpEws\Request\SetUserOofSettingsRequest $request |
675
|
|
|
* @return \jamesiarmes\PhpEws\Response\SetUserOofSettingsResponse |
676
|
|
|
*/ |
677
|
|
|
public function SetUserOofSettings($request) |
678
|
|
|
{ |
679
|
|
|
$this->initializeSoapClient(); |
680
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
681
|
|
|
|
682
|
|
|
return $this->processResponse($response); |
683
|
|
|
} |
684
|
|
|
|
685
|
|
|
/** |
686
|
|
|
* Function Description |
687
|
|
|
* |
688
|
|
|
* @param \jamesiarmes\PhpEws\Request\SubscribeType $request |
689
|
|
|
* @return \jamesiarmes\PhpEws\Response\SubscribeResponseType |
690
|
|
|
*/ |
691
|
|
|
public function Subscribe($request) |
692
|
|
|
{ |
693
|
|
|
$this->initializeSoapClient(); |
694
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
695
|
|
|
|
696
|
|
|
return $this->processResponse($response); |
697
|
|
|
} |
698
|
|
|
|
699
|
|
|
/** |
700
|
|
|
* Function Description |
701
|
|
|
* |
702
|
|
|
* @param \jamesiarmes\PhpEws\Request\SyncFolderHierarchyType $request |
703
|
|
|
* @return \jamesiarmes\PhpEws\Response\SyncFolderHierarchyResponseType |
704
|
|
|
*/ |
705
|
|
|
public function SyncFolderHierarchy($request) |
706
|
|
|
{ |
707
|
|
|
$this->initializeSoapClient(); |
708
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
709
|
|
|
|
710
|
|
|
return $this->processResponse($response); |
711
|
|
|
} |
712
|
|
|
|
713
|
|
|
/** |
714
|
|
|
* Function Description |
715
|
|
|
* |
716
|
|
|
* @param \jamesiarmes\PhpEws\Request\SyncFolderItemsType $request |
717
|
|
|
* @return \jamesiarmes\PhpEws\Response\SyncFolderItemsResponseType |
718
|
|
|
*/ |
719
|
|
|
public function SyncFolderItems($request) |
720
|
|
|
{ |
721
|
|
|
$this->initializeSoapClient(); |
722
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
723
|
|
|
|
724
|
|
|
return $this->processResponse($response); |
725
|
|
|
} |
726
|
|
|
|
727
|
|
|
/** |
728
|
|
|
* Function Description |
729
|
|
|
* |
730
|
|
|
* @param \jamesiarmes\PhpEws\Request\UnsubscribeType $request |
731
|
|
|
* @return \jamesiarmes\PhpEws\Response\UnsubscribeResponseType |
732
|
|
|
*/ |
733
|
|
|
public function Unsubscribe($request) |
734
|
|
|
{ |
735
|
|
|
$this->initializeSoapClient(); |
736
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
737
|
|
|
|
738
|
|
|
return $this->processResponse($response); |
739
|
|
|
} |
740
|
|
|
|
741
|
|
|
/** |
742
|
|
|
* Function Description |
743
|
|
|
* |
744
|
|
|
* @param \jamesiarmes\PhpEws\Request\UpdateDelegateType $request |
745
|
|
|
* @return \jamesiarmes\PhpEws\Response\UpdateDelegateResponseMessageType |
746
|
|
|
*/ |
747
|
|
|
public function UpdateDelegate($request) |
748
|
|
|
{ |
749
|
|
|
$this->initializeSoapClient(); |
750
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
751
|
|
|
|
752
|
|
|
return $this->processResponse($response); |
753
|
|
|
} |
754
|
|
|
|
755
|
|
|
/** |
756
|
|
|
* Function Description |
757
|
|
|
* |
758
|
|
|
* @param \jamesiarmes\PhpEws\Request\UpdateFolderType $request |
759
|
|
|
* @return \jamesiarmes\PhpEws\Response\UpdateFolderResponseType |
760
|
|
|
*/ |
761
|
|
|
public function UpdateFolder($request) |
762
|
|
|
{ |
763
|
|
|
$this->initializeSoapClient(); |
764
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
765
|
|
|
|
766
|
|
|
return $this->processResponse($response); |
767
|
|
|
} |
768
|
|
|
|
769
|
|
|
/** |
770
|
|
|
* Function Description |
771
|
|
|
* |
772
|
|
|
* @param \jamesiarmes\PhpEws\Request\UpdateItemType $request |
773
|
|
|
* @return \jamesiarmes\PhpEws\Response\UpdateItemResponseType |
774
|
|
|
*/ |
775
|
|
|
public function UpdateItem($request) |
776
|
|
|
{ |
777
|
|
|
$this->initializeSoapClient(); |
778
|
|
|
$response = $this->soap->{__FUNCTION__}($request); |
779
|
|
|
|
780
|
|
|
return $this->processResponse($response); |
781
|
|
|
} |
782
|
|
|
|
783
|
|
|
/** |
784
|
|
|
* Initializes the SoapClient object to make a request |
785
|
|
|
* |
786
|
|
|
* @return \jamesiarmes\PhpEws\SoapClient |
787
|
|
|
* |
788
|
|
|
* TODO: Build a class map that we can pass to the client. |
789
|
|
|
*/ |
790
|
|
|
protected function initializeSoapClient() |
791
|
|
|
{ |
792
|
|
|
$this->soap = new SoapClient( |
793
|
|
|
dirname(__FILE__) . '/assets/services.wsdl', |
794
|
|
|
array( |
795
|
|
|
'user' => $this->username, |
796
|
|
|
'password' => $this->password, |
797
|
|
|
'version' => $this->version, |
798
|
|
|
'location' => 'https://' . $this->server . '/EWS/Exchange.asmx', |
799
|
|
|
'impersonation' => $this->impersonation, |
800
|
|
|
) |
801
|
|
|
); |
802
|
|
|
|
803
|
|
|
return $this->soap; |
804
|
|
|
} |
805
|
|
|
|
806
|
|
|
/** |
807
|
|
|
* Process a response to verify that it succeeded and take the appropriate |
808
|
|
|
* action |
809
|
|
|
* |
810
|
|
|
* @throws \Exception |
811
|
|
|
* |
812
|
|
|
* @param \stdClass $response |
813
|
|
|
* @return \stdClass |
814
|
|
|
*/ |
815
|
|
|
protected function processResponse($response) |
816
|
|
|
{ |
817
|
|
|
// If the soap call failed then we need to throw an exception. |
818
|
|
|
$code = $this->soap->getResponseCode(); |
819
|
|
|
if ($code != 200) { |
820
|
|
|
throw new \Exception( |
821
|
|
|
"SOAP client returned status of $code.", |
822
|
|
|
$code |
823
|
|
|
); |
824
|
|
|
} |
825
|
|
|
|
826
|
|
|
return $response; |
827
|
|
|
} |
828
|
|
|
} |
829
|
|
|
|