Closed trailsnail closed 1 year ago
I narrowed the problem further.
the problem is that the stream which is returned in from $request->getBody()
does return a empty-string when invoked with with $request->getBody()->getContents()
but it works when invoked with e.g. magic $request->getBody()->__toString()
it seems a similar problem was fixed in https://github.com/phpro/soap-client/pull/325/files (or worked arround)
Copying the __toString()
behavior, I solved it like this:
$response->getBody()->seek(0);
echo $response->getBody()->getContents();
Your fix is the right one: PSR-7 doesn't specify whether we should seek or not, so it's your job to ensure the offset.
Still, this should be fixed by #217
Hello all,
since we have a dependency to
Nyholm/Psr7
in our project, we get an error with SOAP requests viaphpro/soap-client
.To make it easier to check, I have created an example repository, just follow the info in the readme. If you have any questions, please contact me. We would be happy if someone could help us with the problem.
Thanks a lot
Link to repo: https://github.com/trailsnail/soap-error-streamfactory