|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-13 23:17 UTC] felipe@php.net
[2009-02-21 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 14:00:02 2025 UTC |
Description: ------------ Call a webservice method. Method returns one value, a string. SoapClient internally tries to convert an instance of stdClass into a string before trying to return the value, thus nothing works. Reproduce code: --------------- $packet = array('sessionToken' => $this->searchAuth, 'userId' => '-1', 'expirationDate' => '2008-11-01'); // $this->soap is instance of SoapClient $results = $this->soap->__soapCall('GenerateToken',array($packet)); var_dump($results); Webservice returns: <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <GenerateTokenResponse xmlns="~/WebServices/"> <GenerateTokenResult>string</GenerateTokenResult> </GenerateTokenResponse> </soap12:Body> </soap12:Envelope> Expected result: ---------------- A string containing the value of "GeneratTokenResult" OR class stdClass { public $GenerateTokenResult = 'someKindOfToken'; } Actual result: -------------- Catchable fatal error: Object of class stdClass could not be converted to string error is thrown on the line with __soapCall().