Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setHttpHeaders tries to access SoapClient::$_stream_context property which is private #42

Open
gigerIT opened this issue May 12, 2022 · 1 comment · May be fixed by #46
Open

setHttpHeaders tries to access SoapClient::$_stream_context property which is private #42

gigerIT opened this issue May 12, 2022 · 1 comment · May be fixed by #46
Assignees
Labels

Comments

@gigerIT
Copy link

gigerIT commented May 12, 2022

Hello Everyone

i just came across an error when trying to set custom http headers.
$get->setHttpHeader("x-api-key", "123456");

Which throws an error:
Cannot access private property SoapClient::$_stream_context

Caused by the line 343 in AbstractSoapClientBase:
$state = ($this->getSoapClient()->_stream_context = stream_context_create($options)) ? true : false;

I'm using PHP 8.1

@mikaelcom
Copy link
Member

It's caused by PHP > 8.0. I did not take time to handle this yet. Until PHP <= 8.0, the _stream_context was accessible and allowed to set the stream context used by the SoapClient when sending the request.

If you have any clue or idea to handle this, feel free to share your thoughts.

@mikaelcom mikaelcom self-assigned this May 12, 2022
@mikaelcom mikaelcom added the bug label May 12, 2022
@mikaelcom mikaelcom linked a pull request Feb 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants