Специфические данные ответа WSDL - PullRequest
0 голосов
/ 20 января 2019

Мне только что удалось получить мой ответ WSDL на работу.

От моего var_dump($response); я получаю это:

object(stdClass)#3 (1) { ["ListSitesResult"]=> object(stdClass)#4 (1) { ["Site"]=> array(6) { [0]=> object(stdClass)#5 (7) { ["Id"]=> string(5) "97608" ["Name"]=> string(7) "Name1" ["MaxOccupancy"]=> int(704) ["Occupancy"]=> int(209) ["Hysteres"]=> int(5) ["Marginal"]=> int(10) ["Active"]=> bool(true) } [1]=> object(stdClass)#6 (7) { ["Id"]=> string(5) "97609" ["Name"]=> string(6) "Name2" ["MaxOccupancy"]=> int(180) ["Occupancy"]=> int(92) ["Hysteres"]=> int(5) ["Marginal"]=> int(3) ["Active"]=> bool(true) } [2]=> object(stdClass)#7 (7) { ["Id"]=> string(5) "97611" ["Name"]=> string(8) "Name3" ["MaxOccupancy"]=> int(319) ["Occupancy"]=> int(49) ["Hysteres"]=> int(5) ["Marginal"]=> int(3) ["Active"]=> bool(true) } [3]=> object(stdClass)#8 (7) { ["Id"]=> string(5) "97612" ["Name"]=> string(6) "Name4" ["MaxOccupancy"]=> int(388) ["Occupancy"]=> int(145) ["Hysteres"]=> int(5) ["Marginal"]=> int(10) ["Active"]=> bool(true) } [4]=> object(stdClass)#9 (7) { ["Id"]=> string(6) "111562" ["Name"]=> string(10) "Name5" ["MaxOccupancy"]=> int(151) ["Occupancy"]=> int(70) ["Hysteres"]=> int(5) ["Marginal"]=> int(10) ["Active"]=> bool(true) } [5]=> object(stdClass)#10 (7) { ["Id"]=> string(6) "111563" ["Name"]=> string(10) "Name6" ["MaxOccupancy"]=> int(84) ["Occupancy"]=> int(20) ["Hysteres"]=> int(5) ["Marginal"]=> int(10) ["Active"]=> bool(true) } } } }

Теперь я понятия не имею, как я получаю эти конкретные данные "Занятость" и "Макс. Занятость" из каждого идентификатора. Я хочу работать с $ response или иметь возможность кэшировать данные, чтобы они не вызывали каждый вызов.

что-то на пути $name2 = Occupancy & MaxOccupancy from $response where ID = 97609

Информация о сборке WSDL находится по адресу: https://online.infracontrol.com/Areas/Parking/Services/V1/ParkingInfo.asmx?WSDL

и

https://online.infracontrol.com/Areas/Parking/Services/V1/ParkingInfo.asmx?op=ListSites

Заранее спасибо!

...