tuscanicz / BeSimpleSoap

A largely refactored BeSimple/Soap library used to build SOAP and WSDL based web services. This fork fixes a lot of errors and provides better API, robust, stable and modern codebase. The Api differs so much, that it won't be merged into original repository. If you find an error, please, report an issue here.
8 stars 7 forks source link

_getLastResponse deprecated #12

Closed sanchobouillant closed 6 years ago

sanchobouillant commented 6 years ago

Hi,

I want to use getLastResponse but it's deprecated. How can i get the last response and last request ?

Do you have any code example ?

Thanks

tuscanicz commented 6 years ago

Hi!

You can get a clue in tests dir here: https://github.com/tuscanicz/BeSimpleSoap/blob/master/tests/BeSimple/SoapClient/SoapClientTest.php

For example, see the SoapClientTest::testSoapCallWithCustomEndpointValid test method, here you get the data from $soapResponse->getTracingData()

You have to build SoapClient with tracing data, as you can see in the test case:

SoapClientOptionsBuilder::createWithTracing()

Did it help you? The difference is that these tracing data are immutable. The original native SoapClient methods were holding a state of one of the previous calls which is not the package design you'd like to use.

Petr

sanchobouillant commented 6 years ago

That's perfect. Thanks :)