1 | <?php |
||
13 | class SoapClient extends \SoapClient |
||
14 | { |
||
15 | /** |
||
16 | * cURL resource used to make the SOAP request |
||
17 | * |
||
18 | * @var resource |
||
19 | */ |
||
20 | protected $ch; |
||
21 | |||
22 | /** |
||
23 | * Options passed to the client constructor. |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $options; |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | * |
||
32 | * Additional options: |
||
33 | * - user (string): The user to authenticate with. |
||
34 | * - password (string): The password to use when authenticating the user. |
||
35 | * - curlopts (array): Array of options to set on the curl handler when |
||
36 | * making the request. |
||
37 | * - strip_bad_chars (boolean, default true): Whether or not to strip |
||
38 | * invalid characters from the XML response. This can lead to content |
||
39 | * being returned differently than it actually is on the host service, but |
||
40 | * can also prevent the "looks like we got no XML document" SoapFault when |
||
41 | * the response includes invalid characters. |
||
42 | * - warn_on_bad_chars (boolean, default false): Trigger a warning if bad |
||
43 | * characters are stripped. This has no affect unless strip_bad_chars is |
||
44 | * true. |
||
45 | */ |
||
46 | public function __construct($wsdl, array $options = []) |
||
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | public function __doRequest($request, $location, $action, $version, $one_way = 0) |
||
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | public function __getLastRequestHeaders() |
||
110 | |||
111 | /** |
||
112 | * Returns the response code from the last request |
||
113 | * |
||
114 | * @return integer |
||
115 | * |
||
116 | * @throws \BadMethodCallException |
||
117 | * If no cURL resource has been initialized. |
||
118 | */ |
||
119 | public function getResponseCode() |
||
129 | |||
130 | /** |
||
131 | * Builds the headers for the request. |
||
132 | * |
||
133 | * @param string $action |
||
134 | * The SOAP action to be performed. |
||
135 | */ |
||
136 | protected function buildHeaders($action) |
||
147 | |||
148 | /** |
||
149 | * Cleans the response body by stripping bad characters if instructed to. |
||
150 | */ |
||
151 | protected function cleanResponse() |
||
178 | |||
179 | /** |
||
180 | * Builds an array of curl options for the request |
||
181 | * |
||
182 | * @param string $action |
||
183 | * The SOAP action to be performed. |
||
184 | * @param string $request |
||
185 | * The XML SOAP request. |
||
186 | * @return array |
||
187 | * Array of curl options. |
||
188 | */ |
||
189 | protected function curlOptions($action, $request) |
||
208 | |||
209 | /** |
||
210 | * Pareses the response from a successful request. |
||
211 | * |
||
212 | * @param string $response |
||
213 | * The response from the cURL request, including headers and body. |
||
214 | */ |
||
215 | public function parseResponse($response) |
||
226 | } |
||
227 |