Re: how to grab a list of objects from a soap response

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

 



Thank you Ammarmar!

the var_dump is:

object(stdClass)#4 (1) {
  ["GetProjectListResult"]=>
  object(stdClass)#5 (1) {
    ["any"]=>
string(478) "<projects xmlns=""><project><id>1</id><name>LOGIS_2007-1</name></project><project><id>2</id><name>LOGIS_2007-2</name></project><project><id>3</id><name>LOGIS_2007-3-1</name></project><project><id>4</id><name>LOGIS_2007-4</name></project><project><id>5</id><name>LOGIS_2007-5</name></project><project><id>6</id><name>LOGIS_2007-6</name></project><project><id>7</id><name>MWI_TEST_LOCATIEVELD</name></project><project><id>8</id><name>MWI_TEST_LOCATIE_2</name></project></projects>"
  }
}
Object id #5

Does this mean that I have to parse that string that contains the objects? And how should one do that?

Ammarmar schreef:
But this keeps giving me the error:

Notice: Undefined property: stdClass::$Projects in C:\wamp\www\wsSoilution.php on line 55

Notice: Trying to get property of non-object in C:\wamp\www\wsSoilution.php on line 55

Any suggestions?


The simplest solution is to check the result structure first:

var_dump($result);

Most likely you will get an array of objects.

--
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