note 89156 deleted from soapclient.soapcall by thiago

From: Date: Tue, 24 Feb 2009 15:16:59 +0000
Subject: note 89156 deleted from soapclient.soapcall by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151070@lists.php.net to get a copy of this message
Note Submitter: gmail: thornag ---- I found interesting ?bug? while doing a soap client wrapper here at work. Here is my implementation of __call in class extending native SoapClient public function __call($sFunction, $aArguments = array()) { if(!$this->isAvailable($sFunction)) { return $this->returnError('Could not find requested function', "SOAP method {$sFunction} could not be found on the server. Available methods: ".print_r($this->aAvailableFunctions,1)); } $this->sLastFunctionCall = $sFunction; //for logging purposes try { $mResult = $this->__soapCall($sFunction, $aArguments); } catch (SoapFault $e) { $mResult = $e; } return $this->parseResult($mResult); } Now lets assume that encoding object passed to the method is missing some arguments. We would expect something like this: SOAP-ERROR: Encoding: object hasn't 'customer' property And now from a class level higher if I will do ($this->oSOAPClient variable points at object of class that extends native SoapClient, so the function __call above is called): return $this->mLastResponse = $this->oSOAPClient->$sMethodName($aParameters); This will return the error fine - php is validating the input internally If I will do: $this->mLastResponse = call_user_func_array(array($this->oSOAPClient, $sMethodName), $aParameters); This return is not returned, imput is not validated and the soap call gets sent. Anyone have an idea why?

« previous php.notes (#151070) next »