Z
Z
zhdoon2018-05-16 09:51:45
PHP
zhdoon, 2018-05-16 09:51:45

How to handle soap response?

I am making a request to a SOAP server.

$client = new SoapClient($url);
$res = $client->__doRequest($request, $location, $action, $version);

I receive and print out the response in the browser. This is a printout of the string $res prntscr.com/jigu14
Trying to convert the resulting string into an object Getting
$ob = simplexml_load_string($res);
an empty object:
SimpleXMLElement Object
(
)
What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasya, 2018-05-16
@haramba

1. If you do print_r((string) $ob), what will it show?
2. Call libxml_get_errors, what will it return?
3. Before parsing, set whether warnings will appear?
error_reporting(E_ALL | E_WARNING);
ini_set(E_ALL | E_WARNING);
4. What's in $ob->children(). ?
5. You can also parse such an answer with a regular expression.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question