PHP Classes

__getLastRequest and __getLastResponse are not supported

Recommend this page to a friend!

      SOAP Proxy  >  All threads  >  __getLastRequest and...  >  (Un) Subscribe thread alerts  
Subject:__getLastRequest and...
Summary:Why not have these methods available?
Messages:1
Author:Robert Christiaanse
Date:2017-02-17 10:22:35
 

  1. __getLastRequest and...   Reply   Report abuse  
Picture of Robert Christiaanse Robert Christiaanse - 2017-02-17 10:22:35
Shouldn't you have methods __getLastRequest and __getLastResponse available in your standard implementation?

Fixed it by modifying SoapProxy.php.

<?php

abstract class SoapProxy {

/**
* SoapClient
* @var SoapClient
*/
protected $soapClient = null;


/**
* Class constructor
* Initialize SoapClient
* @param string $wsdl - wsdl address
* @param array $opts - SoapClient options see http://php.net/manual/en/soapclient.soapclient.php
*/
public function __construct($wsdlUrl, $opts = array()) {
if (isset($opts['classmap'])) {
$opts['classmap'] = array_merge($this->defaultTypeMap, $opts['classmap']);
} else {
$opts['classmap'] = $this->defaultTypeMap;
}

$this->soapClient = new SoapProxyClient(
$wsdlUrl,
$opts
);
}

/**
* Get last request message
*/
public function getLastRequest()
{
return $this->soapClient->getLastRequest();
}

/**
* Get last response message
*/
public function getLastResponse()
{
return $this->soapClient->getLastResponse();
}
}

/**
* Stub for SoapClient
* Extends PHP SoapClient to easly modyfiing
*
* @author przemek berezowski
*/
class SoapProxyClient extends SoapClient {

/**
* Get last request message
*/
function getLastRequest()
{
return $this->__getLastRequest();
}

/**
* Get last response message
*/
function getLastResponse()
{
return $this->__getLastResponse();
}
}