1 | <?php |
||
28 | class SoapNative extends SoapBase implements SoapInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var SoapClientExtended |
||
32 | */ |
||
33 | protected $connection; |
||
34 | |||
35 | /** |
||
36 | * Constructor |
||
37 | * @param Certificate $certificate |
||
38 | * @param LoggerInterface $logger |
||
39 | */ |
||
40 | 1 | public function __construct(Certificate $certificate = null, LoggerInterface $logger = null) |
|
44 | |||
45 | /** |
||
46 | * Send soap message to url |
||
47 | * @param string $url |
||
48 | * @param string $operation |
||
49 | * @param string $action |
||
50 | * @param int $soapver |
||
51 | * @param array $parameters |
||
52 | * @param array $namespaces |
||
53 | * @param string $request |
||
54 | * @param \SoapHeader $soapheader |
||
55 | * @return string |
||
56 | * @throws SoapException |
||
57 | */ |
||
58 | public function send( |
||
59 | $url, |
||
60 | $operation = '', |
||
61 | $action = '', |
||
62 | $soapver = SOAP_1_2, |
||
63 | $parameters = [], |
||
64 | $namespaces = [], |
||
65 | $request = '', |
||
66 | $soapheader = null |
||
67 | ) { |
||
68 | $this->prepare($url, $soapver); |
||
69 | try { |
||
70 | if (!empty($soapheader)) { |
||
71 | $this->connection->__setSoapHeaders(array($soapheader)); |
||
72 | } |
||
73 | $this->connection->$operation($parameters); |
||
74 | $this->requestHead = $this->connection->__getLastRequestHeaders(); |
||
75 | $this->requestBody = $this->connection->__getLastRequest(); |
||
76 | $this->responseHead = $this->connection->__getLastResponseHeaders(); |
||
77 | $this->responseBody = $this->connection->__getLastResponse(); |
||
78 | $this->saveDebugFiles( |
||
79 | $operation, |
||
80 | $this->requestHead . "\n" . $this->requestBody, |
||
81 | $this->responseHead . "\n" . $this->responseBody |
||
82 | ); |
||
83 | } catch (SoapFault $e) { |
||
84 | throw SoapException::soapFault("[$url] " . $e->getMessage()); |
||
|
|||
85 | } catch (\Exception $e) { |
||
86 | throw SoapException::soapFault("[$url] " . $e->getMessage()); |
||
87 | } |
||
88 | return $this->responseBody; |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * Prepare connection |
||
93 | * @param string $url |
||
94 | * @param int $soapver |
||
95 | * @throws SoapException |
||
96 | */ |
||
97 | protected function prepare($url, $soapver = SOAP_1_2) |
||
129 | |||
130 | /** |
||
131 | * Set parameters for proxy |
||
132 | * @param array $params |
||
133 | * @return array |
||
134 | */ |
||
135 | private function setNativeProxy($params) |
||
153 | } |
||
154 |
This check looks for function calls that miss required arguments.