Hi All,
I'm new to PHP (not to coding) - and I've been able to bang out most answers using books, the web and brue force - but this one has me stumped.
(If it's been covered before, sorry, I'm being lazy for not searching)...
So, here's the problem:
I have a call to my internal system that returns XML data via a SOAP call.
The call works great - data is returned as I would expect.
Like I've read, I put said data into a variable usng simpleXML like this: $xml = simplexml_load_string($response3); ($response3 being where the raw data is)
When I do a var_dump of $xml, I get this:
SimpleXMLElement Object ( [iCProductAvailByWhseResult] => SimpleXMLElement Object ( [errorMessage] => SimpleXMLElement Object ( ) [arrayAvailability] => SimpleXMLElement Object ( [iCProductAvailByWhse.output.Availability] => Array ( [0] => SimpleXMLElement Object ( [productCode] => xxx [description1] => yyy [description2] => zzz [warehouse] => aaa [netAvailable] => bbb ) [1] => SimpleXMLElement Object ( [productCode] => xxx [description1] => yyy [description2] => zzz [warehouse] => aaa [netAvailable] => bbb ) [2] => SimpleXMLElement Object ( [productCode] => xxx [description1] => yyy [description2] => zzz [warehouse] => aaa [netAvailable] => bbb )
**** Edited, I got real data, not xxx,yyy, etc... ****
Now the issue: It seems like I have everything in place - all I need now is to get my data off to variables for display.
I've tried everything I can think of and I just can't seem to get it.
I ran $xml->getName() and it gave me: ICProductAvailByWhseResult
So, simple I think, I should be able to print something like $xml->ICProductAvailByWhseResult[0]->warehouse and I should get something, right?
Nope.
So I try $xml->ICProductAvailByWhseResult[1]->warehouse and I get a notice that I'm trying to get to a property of a non-object.
What am I missing? I come from a VB backgound, so I understand array's and such - but this one has be stumped.
And help would be greatly appreciated...
Thanks!!