D
D
Daria2017-10-10 07:01:29
PHP
Daria, 2017-10-10 07:01:29

How to parse soap response in php?

Good afternoon everyone.
Help parse the soap response. The request passes, the response comes, but I can’t get to the necessary data, although they are in the response
Request:
$client = new SoapClient("хххххххххххх?wsdl", array( 'soap_version' => SOAP_1_2));
var_dump($client->GetCity());
I get:
59dc42c575134683364866.jpeg
How to get to the cityid / cityname elements?
$result = $client->GetCity();
$result ->City->CityId in response I get NULL
$result ->Data->City->CityId is also NULL
And the second question, is it possible to overtake the resulting string in xml, or are there more convenient ways to work with the received data?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-10-10
@greymika

to show the result not only with porridge, but also with a screen - this is a masterpiece.
instead of var_dump($client->GetCity()); do echo json_encode($client->GetCity()); and post the result.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question