Bug #73538 [NEW]: SoapClient::__setSoapHeaders doesn't overwrite SOAP headers

From: Date: Wed, 16 Nov 2016 09:13:42 +0000
Subject: Bug #73538 [NEW]: SoapClient::__setSoapHeaders doesn't overwrite SOAP headers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205396@lists.php.net to get a copy of this message
From: phpbugs at agares dot info Operating system: Windows 10, Ubuntu 16.10 PHP version: 7.0.13 Package: SOAP related Bug Type: Bug Bug description:SoapClient::__setSoapHeaders doesn't overwrite SOAP headers Description: ------------ When I pass an array of headers to __setSoapHeaders, subsequent calls do not overwrite the previous headers. It works correctly when I pass a single object to that method. Test script: --------------- <?php $client = new \SoapClient(null, [ 'trace' => 1, 'exceptions' => true, 'uri' => '', 'location' => '', ]); $client->__setSoapHeaders([new \SoapHeader('ns', 'Header', ['something' => 1])]); $client->__setSoapHeaders([new \SoapHeader('ns', 'Header', ['something' => 2])]); try { $client->__soapCall('SomeMethod', ['a' => 'b']); } catch(\Exception $e) { } var_dump($client->__getLastRequest()); var_dump($client->__getLastRequestHeaders()); Expected result: ---------------- Can't post the whole XML because of spam detection, so just a fragment: ><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>1</value></item></ns2:Header></SOAP-ENV:Header> Actual result: -------------- ><SOAP-ENV:Header><ns2:Header><item><key>something</key><value>2</value></item></ns2:Header></SOAP-ENV:Header> -- Edit bug report at https://bugs.php.net/bug.php?id=73538&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73538&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73538&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73538&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73538&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73538&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73538&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73538&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73538&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73538&r=support Expected behavior: https://bugs.php.net/fix.php?id=73538&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73538&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73538&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73538&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73538&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73538&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73538&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73538&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73538&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73538&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73538&r=mysqlcfg

« previous php.bugs (#205396) next »