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

Deal with null responses coming back from server #9

Merged
merged 1 commit into from
Jan 28, 2022

Conversation

veewee
Copy link
Member

@veewee veewee commented Jan 28, 2022

Q A
Type improvement
BC Break no
Fixed issues #7

Summary

Investigated #7 a bit deeper.
Turns out that null is being used as an error result here.
For one_time, the result is an empty string.

So it is safe to add some additional error handling around the return type of the doActualRequest method.
It detect timeouts and other internal errors.
Besides that, it checks the result. If it is null, we assume it is a broken result.

More info:
https://github.com/php/php-src/blob/74f7f2c4b1f4d486c7f767a65c02f6e6bab27c3b/ext/soap/soap.c#L2683-L2711

For other transports then the ExtSoapClientTransport, we already assume the output to be a valid string.
E.g. The PSr18Transport will throw exceptions on HTTP errors.

@veewee veewee added the enhancement New feature or request label Jan 28, 2022
@veewee veewee merged commit 7454015 into main Jan 28, 2022
@veewee veewee deleted the deal-with-null-responses branch January 28, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant