@@ -6,30 +6,30 @@ discard block |
||
6 | 6 | |
7 | 7 | trait ApiTrait { |
8 | 8 | |
9 | - private $config; |
|
10 | - private $wsshead; |
|
11 | - private $user; |
|
12 | - private $pass; |
|
13 | - private $client; |
|
9 | + private $config; |
|
10 | + private $wsshead; |
|
11 | + private $user; |
|
12 | + private $pass; |
|
13 | + private $client; |
|
14 | 14 | |
15 | 15 | |
16 | - public function apiCall($call,$query,$service) |
|
17 | - { |
|
18 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
16 | + public function apiCall($call,$query,$service) |
|
17 | + { |
|
18 | + $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
19 | 19 | |
20 | - $this->user = $config->user; |
|
21 | - $this->pass = $config->pass; |
|
22 | - $this->client = $config->client; |
|
23 | - $this->wsshead = $this->getWSSHeader(); |
|
20 | + $this->user = $config->user; |
|
21 | + $this->pass = $config->pass; |
|
22 | + $this->client = $config->client; |
|
23 | + $this->wsshead = $this->getWSSHeader(); |
|
24 | 24 | |
25 | 25 | $client = new \SoapClient($service); |
26 | 26 | $client->__setSoapHeaders($this->wsshead); |
27 | 27 | $response = $client->$call($query); |
28 | 28 | return $response; |
29 | - } |
|
29 | + } |
|
30 | 30 | |
31 | - public function getWSSHeader() |
|
32 | - { |
|
31 | + public function getWSSHeader() |
|
32 | + { |
|
33 | 33 | $xml = ' |
34 | 34 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
35 | 35 | <wsse:UsernameToken atd:clientId="' . $this->client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
@@ -40,6 +40,6 @@ discard block |
||
40 | 40 | '; |
41 | 41 | |
42 | 42 | return new \SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', new \SoapVar($xml, XSD_ANYXML), true); |
43 | - } |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | private $client; |
14 | 14 | |
15 | 15 | |
16 | - public function apiCall($call,$query,$service) |
|
16 | + public function apiCall($call, $query, $service) |
|
17 | 17 | { |
18 | - $config = include(realpath(dirname(__FILE__) . '/../config/config.php')); |
|
18 | + $config = include(realpath(dirname(__FILE__).'/../config/config.php')); |
|
19 | 19 | |
20 | 20 | $this->user = $config->user; |
21 | 21 | $this->pass = $config->pass; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $client = new \SoapClient($service); |
26 | 26 | $client->__setSoapHeaders($this->wsshead); |
27 | - $response = $client->$call($query); |
|
27 | + $response = $client->$call($query); |
|
28 | 28 | return $response; |
29 | 29 | } |
30 | 30 | |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | { |
33 | 33 | $xml = ' |
34 | 34 | <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> |
35 | - <wsse:UsernameToken atd:clientId="' . $this->client . '" xmlns:atd="http://api.atdconnect.com/atd"> |
|
36 | - <wsse:Username>' . $this->user . '</wsse:Username> |
|
37 | - <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $this->pass . '</wsse:Password> |
|
35 | + <wsse:UsernameToken atd:clientId="' . $this->client.'" xmlns:atd="http://api.atdconnect.com/atd"> |
|
36 | + <wsse:Username>' . $this->user.'</wsse:Username> |
|
37 | + <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $this->pass.'</wsse:Password> |
|
38 | 38 | </wsse:UsernameToken> |
39 | 39 | </wsse:Security> |
40 | 40 | '; |