Fixes #42 SoapClient->_stream_context is private in php 8
SoapClient->_stream_context is private in php8. To work around that a stream context is systematically created during init and provided to SoapClient.
Another aproach I tried before was to get access to SoapClient->_stream_context through reflection or a closure. That trick does not work for php internal classes, and felt a bit hacky.
I had to remove AbstractSoapClientBase->setSoapClient, since we lose access to the stream context if SoapClient is created externally. That's a potential breaking change.
Hi, thanks for the PR. As the composer.json currently stipulates it must work from PHP>=7.4, even if the tests passes, I must test this enhancement within a real generated package and within the PackageGenerator project. Did you have the chance to do so already?
Yes, that change is live on a project running php 7.4 with a generated client and custom http headers. No problems so far.
As you mentionned SoapClient->_stream_context is private in php8., wouldn't it more appropriate to create a new major version requiring PHP >= 8 embedding this enhancement?
The removal of AbstractSoapClientBase->setSoapClient may break stuff downstream, so a new major version makes sense.