From 15f1bc30a1b94274a40bd6aa2c487a9f05ba28e3 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 24 Nov 2025 14:34:30 +0100 Subject: [PATCH 1/2] Force Envelope when detecting SOAP --- src/Service/RequestService.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Service/RequestService.php b/src/Service/RequestService.php index 2148610a..d8db1b37 100644 --- a/src/Service/RequestService.php +++ b/src/Service/RequestService.php @@ -226,6 +226,14 @@ public function serializeData(array $data, &$contentType, ?string $xmlRootNode = $endpoint = $this->data['endpoint']; } + if($xmlRootNode === null && in_array('http://schemas.xmlsoap.org/soap/envelope/', $data) === true){ + $nsRef = array_search(needle: 'http://schemas.xmlsoap.org/soap/envelope/', haystack: $data); + [$xmlns, $ns] = explode(separator: ':', string: $nsRef, limit: 2); + + $xmlRootNode = "$ns:Envelope"; + } + + $encoderSettings = ['xml_encoding' => 'utf-8']; if ($xmlRootNode) { $encoderSettings['xml_root_node_name'] = $xmlRootNode; @@ -807,6 +815,10 @@ public function proxyHandler(array $data, array $configuration, ?Source $proxy = unset($headers['Content-Length']); } + if ($data['accept'] !== $headers['content-type'][0]) { + $headers['content-type'] = $data['accept']; + } + // Let create a response from the guzzle call. $response = new Response( $this->serializeData($resultContent, $contentType, $xmlRootNode), From 0fc8d9f1c3ba6b43b350ac5f924866b31f58135a Mon Sep 17 00:00:00 2001 From: GitHub Actions <> Date: Mon, 24 Nov 2025 13:35:33 +0000 Subject: [PATCH 2/2] Update src from PHP Codesniffer --- src/Service/RequestService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Service/RequestService.php b/src/Service/RequestService.php index d8db1b37..9a430392 100644 --- a/src/Service/RequestService.php +++ b/src/Service/RequestService.php @@ -226,14 +226,16 @@ public function serializeData(array $data, &$contentType, ?string $xmlRootNode = $endpoint = $this->data['endpoint']; } - if($xmlRootNode === null && in_array('http://schemas.xmlsoap.org/soap/envelope/', $data) === true){ + if ($xmlRootNode === null && in_array('http://schemas.xmlsoap.org/soap/envelope/', $data) === true) { $nsRef = array_search(needle: 'http://schemas.xmlsoap.org/soap/envelope/', haystack: $data); - [$xmlns, $ns] = explode(separator: ':', string: $nsRef, limit: 2); + [ + $xmlns, + $ns, + ] = explode(separator: ':', string: $nsRef, limit: 2); $xmlRootNode = "$ns:Envelope"; } - $encoderSettings = ['xml_encoding' => 'utf-8']; if ($xmlRootNode) { $encoderSettings['xml_root_node_name'] = $xmlRootNode;