How to handle soap response?

Make a request to the SOAP server.
$client = new SoapClient($url);
$res = $client->__doRequest($request, $location, $action, $version);

Get and print in browser the answer. It print string $res prntscr.com/jigu14

Trying to convert the received string into an object
$ob = simplexml_load_string($res);

Get an empty object:
SimpleXMLElement Object
(
)

What's wrong?
June 5th 19 at 21:52
1 answer
June 5th 19 at 21:54
1. If you do print_r((string) $ob) that will show?
2. Call libxml_get_errors that back?
3. Before parsing set, warnings will appear?
error_reporting(E_ALL | E_WARNING);
ini_set(E_ALL | E_WARNING);
4. That $ob->children(). ?
5. Possible and a regular expression to parse this response.
There are no errors. In $ob->children() an empty object. - Jett_Au commented on June 5th 19 at 21:57
,
The feeling that he doesn't like
<?xml ...</code><br> Try the normal tag write manually feed f and simplexml_load_string--> - Akeem.Frits commented on June 5th 19 at 22:00
And providerwith response
https://www.xmlvalidation.com - Akeem.Frits commented on June 5th 19 at 22:03
as times checked this option. The validator passes, but the object of this line is still not created( or Rather created, but empty. - Jett_Au commented on June 5th 19 at 22:06
, php.net/manual/en/function.simplexml-load-string.php
Check the xml from the example, also with the Russian text.
Additionally would in notepad++ to see all characters including non-printable.
In the comments tag.no, they write that when some characters are not parsed. - Akeem.Frits commented on June 5th 19 at 22:09
Checked out your other xml. Everything worked as it should. There is a suspicion that the problem is the colons in the tags. - Jett_Au commented on June 5th 19 at 22:12
yeah , maybe. Looked at in another script is a replacement of xmlns: in an empty string - Akeem.Frits commented on June 5th 19 at 22:15

Find more questions by tags PHPSOAPXML