PackageBase
PackageBase copied to clipboard
setSoapHeader calls overwrite previously set headers
This seems to be a PHP 8 issue. Due to the __default_headers being a private property, subsequent calls to setSoapHeader overwrite the previously set headers.
Might be fixed by https://github.com/WsdlToPhp/PackageBase/pull/46, but tests are failling for now, I did not have the time to fix it yet
I think the fix would be to change the signature of AbstractSoapClientBase->setSoapHeader to allow for an array, or add another method to setup the default headers. Currently, no matter what setSoapHeader will always override headers not set directly on the underlying SOAP client. It seems that due to all the properties goign private in PHP 8, the only way to properly do this is to manage the headers internal to the abstract class. Or, if the user wants this functionality, they could expose the __default_headers in their own __soap_client.
The fix in #46 of removing ->setSoapClient isn't acceptable as we need to be able to inherit and override some of the base calls in order to implement logging and such.
Feel free to make a PR if you're comfortable enough, we'll discuss about it then, thanks