forked from JeremyDunn/php-fedex-api-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequest.php
More file actions
38 lines (33 loc) · 1.26 KB
/
Request.php
File metadata and controls
38 lines (33 loc) · 1.26 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
<?php
namespace FedEx\LocatorService;
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 Locator Service
*/
class Request extends AbstractRequest
{
const PRODUCTION_URL = 'https://ws.fedex.com:443/web-services';
const TESTING_URL = 'https://wsbeta.fedex.com:443/web-services';
protected static $wsdlFileName = 'LocatorService_v2.wsdl';
/**
* Sends the FedExLocatorRequest and returns the response
*
* @param ComplexType\FedExLocatorRequest $fedExLocatorRequest
* @param bool $returnStdClass Return the $stdClass response directly from \SoapClient
* @return ComplexType\FedExLocatorReply|stdClass
*/
public function getFedExLocatorReply(ComplexType\FedExLocatorRequest $fedExLocatorRequest, $returnStdClass = false)
{
$response = $this->getSoapClient()->fedExLocator($fedExLocatorRequest->toArray());
if ($returnStdClass) {
return $response;
}
$fedExLocatorReply = new ComplexType\FedExLocatorReply;
$fedExLocatorReply->populateFromStdClass($response);
return $fedExLocatorReply;
}
}