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

Incorrect work with SoapClient::__doRequest() #3

Closed
KorDum opened this issue Nov 15, 2021 · 3 comments · Fixed by #4
Closed

Incorrect work with SoapClient::__doRequest() #3

KorDum opened this issue Nov 15, 2021 · 3 comments · Fixed by #4

Comments

@KorDum
Copy link

KorDum commented Nov 15, 2021

Bug Report

Q A
BC Break no
Version 1.1.0

Summary

Hello! SoapClient::__doRequest() does return nullable string, but AbusedClient::doActualRequest() expects string always.

https://www.php.net/manual/en/soapclient.dorequest.php

public SoapClient::__doRequest(
    string $request,
    string $location,
    string $action,
    int $version,
    bool $oneWay = false
): ?string
Soap\ExtSoapEngine\AbusedClient::doActualRequest(): Return value must be of type string, null returned
#0 php-soap/ext-soap-engine/src/Transport/ExtSoapClientTransport.php(26): Soap\ExtSoapEngine\AbusedClient->doActualRequest()
#1 php-soap/engine/src/SimpleEngine.php(25): Soap\ExtSoapEngine\Transport\ExtSoapClientTransport->request()
#2 phpro/soap-client/src/Phpro/SoapClient/Caller/EngineCaller.php(27): Soap\Engine\SimpleEngine->request()
#3 phpro/soap-client/src/Phpro/SoapClient/Caller/EventDispatchingCaller.php(30): Phpro\SoapClient\Caller\EngineCaller->__invoke()

How to reproduce

Sorry, I can't reproduce. You can replace to stub in test.

Expected behaviour

Without exception :)

@veewee
Copy link
Member

veewee commented Nov 15, 2021

Hello @KorDum,

Missed that one indeed. Can you validate if #4 fixes the issue for you? It used to work like that in the old phpro/soap-client.

The method returns null on timeouts etc right? Will try to validate myself as well later this week.

Reported the issue to psalm as well. Since I removed the cast because they expect the type to be string.

@KorDum
Copy link
Author

KorDum commented Nov 15, 2021

Great! Looks like true.

It was possible without casting with the usual condition ?? ''. But it will work like that of course.

The method returns null on timeouts etc right?

Seems to be

@veewee veewee closed this as completed in #4 Nov 15, 2021
@veewee
Copy link
Member

veewee commented Nov 15, 2021

Alright. Tested it myself as well by setting the default_socket_timeout to 0.

Merged and released:
https://github.com/php-soap/ext-soap-engine/releases/tag/v1.1.1

Thanks for reporting! Hope it works again like you'dd expect from now on :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants