#33631 [Asn->Bgs]: SOAP-RPC calls with parameters only succeed when __call() invoked explicitly

From: Date: Mon, 11 Jul 2005 07:41:57 +0000
Subject: #33631 [Asn->Bgs]: SOAP-RPC calls with parameters only succeed when __call() invoked explicitly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-81661@lists.php.net to get a copy of this message
ID: 33631 Updated by: dmitry@php.net Reported By: jw at jwscripts dot com -Status: Assigned +Status: Bogus Bug Type: SOAP related Operating System: Windows XP PHP Version: 5.1.0b2 Assigned To: dmitry New Comment: getRate() SOAP method accepts two arguments. You pass them proper using __call() because it accepts array of argument. Using getRate() you shouldn't pass array but just one by one. $client->getRate('USA', 'UK'); I got float(0.5736) Previous Comments: ------------------------------------------------------------------------ [2005-07-10 12:14:12] jw at jwscripts dot com Description: ------------ SOAP-RPC calls with parameters only succeed when __call() invoked explicitly; when no parameters are required, $soapclient->functionName() succeed as expected. In the reproduce code below, when replacing: $result = $client->getRate($params); with $result = $client->__call('getRate', $params); everything works... Reproduce code: --------------- $wsdl = 'http://www.xmethods.net/sd/CurrencyExchangeService.wsdl'; // Parameters to send $params = array( 'country1' => 'USA', 'country2' => 'UK' ); $client = new SoapClient($wsdl); $result = $client->getRate($params); Expected result: ---------------- No output Actual result: -------------- Notice: Array to string conversion in G:\Apache Group\Apache2\htdocs\xins-soap\rpc-test.php on line 13 Notice: Undefined property: SoapFault::$faultstring in Unknown on line 0 Fatal error: Uncaught SoapFault exception: [soap:Server] (null) in G:\Apache Group\Apache2\htdocs\xins-soap\rpc-test.php:13 Stack trace: #0 G:\Apache Group\Apache2\htdocs\xins-soap\rpc-test.php(13): SoapClient->__call('getRate', Array) #1 G:\Apache Group\Apache2\htdocs\xins-soap\rpc-test.php(13): SoapClient->getRate(Array) #2 {main} thrown in G:\Apache Group\Apache2\htdocs\xins-soap\rpc-test.php on line 13 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33631&edit=1

« previous php.bugs (#81661) next »