From 51e6fe113552c9bfdadbaa94b07a9d958254ca64 Mon Sep 17 00:00:00 2001 From: Nicholas Hagen Date: Fri, 6 Nov 2020 10:32:57 -0500 Subject: [PATCH 1/3] Issue #2153 Remove resetting the parameters and options after executing the soap request. --- classes/request/soap.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/classes/request/soap.php b/classes/request/soap.php index 2fb9f8deec..79fcc0c849 100644 --- a/classes/request/soap.php +++ b/classes/request/soap.php @@ -145,29 +145,14 @@ public function execute(array $additional_params = array()) $mime = $this->response_info('content_type', 'application/soap+xml'); $this->set_response($body, $this->response_info('http_code', 200), $mime, $headers, isset($this->headers['Accept']) ? $this->headers['Accept'] : null); - $this->set_defaults(); return $this; } catch (\SoapFault $e) { - $this->set_defaults(); throw new \RequestException($e->getMessage(), $e->getCode(), $e); } } - /** - * Extends parent to reset headers as well - * - * @return Request_Soap - */ - protected function set_defaults() - { - parent::set_defaults(); - $this->function = ''; - - return $this; - } - /** * Get functions defined in WSDL * From 53c901ae5746c6c1fbcb559cdb2c3f82e1aa1351 Mon Sep 17 00:00:00 2001 From: Nicholas Hagen Date: Fri, 6 Nov 2020 10:47:54 -0500 Subject: [PATCH 2/3] maybe this is safer? only reset the defaults if trace option is NOT set! --- classes/request/soap.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/classes/request/soap.php b/classes/request/soap.php index 79fcc0c849..3878d63625 100644 --- a/classes/request/soap.php +++ b/classes/request/soap.php @@ -145,13 +145,31 @@ public function execute(array $additional_params = array()) $mime = $this->response_info('content_type', 'application/soap+xml'); $this->set_response($body, $this->response_info('http_code', 200), $mime, $headers, isset($this->headers['Accept']) ? $this->headers['Accept'] : null); + $this->set_defaults(); return $this; } catch (\SoapFault $e) { + $this->set_defaults(); throw new \RequestException($e->getMessage(), $e->getCode(), $e); } } + + /** + * Extends parent to reset headers as well + * + * @return Request_Soap + */ + protected function set_defaults() + { + if (empty($this->options['trace'])) + { + parent::set_defaults(); + $this->function = ''; + } + + return $this; + } /** * Get functions defined in WSDL From 6e950f9a64e4ede540b64e8868f9bbf8f5815d55 Mon Sep 17 00:00:00 2001 From: Nicholas Hagen Date: Fri, 6 Nov 2020 10:48:33 -0500 Subject: [PATCH 3/3] remove whitespace --- classes/request/soap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/request/soap.php b/classes/request/soap.php index 3878d63625..10d8ab0d4c 100644 --- a/classes/request/soap.php +++ b/classes/request/soap.php @@ -154,7 +154,7 @@ public function execute(array $additional_params = array()) throw new \RequestException($e->getMessage(), $e->getCode(), $e); } } - + /** * Extends parent to reset headers as well *