Question on type casting for SOAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to merge from nuSOAP to the PHP5 SOAP ext and I'm getting a fatal error

b>Fatal error</b>:  Cannot use object of type stdClass as array

when I var_dump the results of my soap call I noticed the array it returns is an array of objects?

array(6) {
  [0]=>
  object(stdClass)#12 (6) {
    ["N1"]=>
    int(88)
    ["N2"]=>
    int(98)
    ["S1"]=>
    string(12) "this is a test"
    ["S2"]=>
    string(9) "http"
    ["S3"]=>
    string(3) "tcp"
    ["S4"]=>
    string(24) "Linux Configuration Tool"
  }

however nusoap returns as a standard array and the only way I got the old code to work was to cast as an array as I loop through the results

foreach ($array as $key=>$value)
		$value = (array)$value;

which sucks for backwards compatibility. Anyone have any better ideas on how I might be able to resolve the issue?

--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux