mardi 4 août 2015

Extraction of data from Soap Response in Php

I did a SOAP/WSDL request with a PHP script. I could access an answer which look like this :

stdClass Object
(
     [inventory] => Array[inventory] => Array
     (
        [0] => stdClass Object
               (
                [location_inventory] => stdClass Object
                    (
                        [location] => stdClass Object
                            (
                                [organization] => abcdef
                                [contact] => stdClass Object
                                    (
                                        [contact_details] => stdClass Object
                                            (
                                                [id] => Thomas
                                            )
                                    )
                            )
                        [product] => tomatoes
                    )
            )
    )
)

The point is that I can't extract the variables "organization", "id", or "product".

What is the difference of syntax when accessing a stdClass Object or an Array ?

Aucun commentaire:

Enregistrer un commentaire