-
Notifications
You must be signed in to change notification settings - Fork 183
/
Copy pathRequest.php
76 lines (67 loc) · 3.1 KB
/
Request.php
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
<?php
namespace FedEx\UploadDocumentService;
use FedEx\AbstractRequest;
/**
* Request sends the SOAP call to the FedEx servers and returns the response
*
* @author Jeremy Dunn <[email protected]>
* @package PHP FedEx API wrapper
* @subpackage Upload Document Service
*/
class Request extends AbstractRequest
{
const PRODUCTION_URL = 'https://ws.fedex.com:443/web-services/uploaddocument';
const TESTING_URL = 'https://wsbeta.fedex.com:443/web-services/uploaddocument';
protected static $wsdlFileName = 'UploadDocumentService_v19.wsdl';
/**
* Sends the UploadDocumentsRequest and returns the response
*
* @param ComplexType\UploadDocumentsRequest $uploadDocumentsRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\UploadDocumentsReply|stdClass
*/
public function getUploadDocumentsReply(ComplexType\UploadDocumentsRequest $uploadDocumentsRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->uploadDocuments($uploadDocumentsRequest->toArray());
if ($returnStdClass) {
return $response;
}
$uploadDocumentsReply = new ComplexType\UploadDocumentsReply;
$uploadDocumentsReply->populateFromStdClass($response);
return $uploadDocumentsReply;
}
/**
* Sends the UploadDocumentsWithShipmentDataRequest and returns the response
*
* @param ComplexType\UploadDocumentsWithShipmentDataRequest $uploadDocumentsWithShipmentDataRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\UploadDocumentsWithShipmentDataReply|stdClass
*/
public function getUploadDocumentsWithShipmentDataReply(ComplexType\UploadDocumentsWithShipmentDataRequest $uploadDocumentsWithShipmentDataRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->uploadDocumentsWithShipmentData($uploadDocumentsWithShipmentDataRequest->toArray());
if ($returnStdClass) {
return $response;
}
$uploadDocumentsWithShipmentDataReply = new ComplexType\UploadDocumentsWithShipmentDataReply;
$uploadDocumentsWithShipmentDataReply->populateFromStdClass($response);
return $uploadDocumentsWithShipmentDataReply;
}
/**
* Sends the UploadImagesRequest and returns the response
*
* @param ComplexType\UploadImagesRequest $uploadImagesRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\UploadImagesReply|stdClass
*/
public function getUploadImagesReply(ComplexType\UploadImagesRequest $uploadImagesRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->uploadImages($uploadImagesRequest->toArray());
if ($returnStdClass) {
return $response;
}
$uploadImagesReply = new ComplexType\UploadImagesReply;
$uploadImagesReply->populateFromStdClass($response);
return $uploadImagesReply;
}
}