php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33631 SOAP-RPC calls with parameters only succeed when __call() invoked explicitly
Submitted: 2005-07-10 12:14 UTC Modified: 2005-07-11 09:41 UTC
From: jw at jwscripts dot com Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.1.0b2 OS: Windows XP
Private report: No CVE-ID: None
 [2005-07-10 12:14 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-11 09:41 UTC] dmitry@php.net
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)
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC