Phpro\SoapClient\Client::debugLastSoapRequest PHP Method

debugLastSoapRequest() public method

Make it possible to debug the last request.
public debugLastSoapRequest ( ) : array
return array
    public function debugLastSoapRequest()
    {
        return ['request' => ['headers' => $this->soapClient->__getLastRequestHeaders(), 'body' => $this->soapClient->__getLastRequest()], 'response' => ['headers' => $this->soapClient->__getLastResponseHeaders(), 'body' => $this->soapClient->__getLastResponse()]];
    }

Usage Example

 function it_should_be_able_to_register_a_response(Client $client, RequestEvent $requestEvent, ResultInterface $result, ResponseEvent $responseEvent)
 {
     $debugData = ['request' => ['headers' => 'SoapRequestHeader', 'body' => '<?xml version="1.0" encoding="UTF-8"?><body>SoapRequestBody</body>'], 'response' => ['headers' => 'SoapResponseHeader', 'body' => '<?xml version="1.0" encoding="UTF-8"?><body>SoapResponseBody</body>']];
     $client->debugLastSoapRequest()->willReturn($debugData);
     $responseEvent->getResponse()->willReturn($result);
     $responseEvent->getClient()->willReturn($client);
     $this->onClientRequest($requestEvent);
     $this->onClientResponse($responseEvent);
     $this->getCalls()->shouldHaveCount(1);
 }
All Usage Examples Of Phpro\SoapClient\Client::debugLastSoapRequest