1
I am making a request to a web service (done in Delphi), by PHP sending an XML and receiving a reply.
What I want is to be able to show XML exactly as it is.
Code I use:
$getData
is the request XML
$client = new SoapClient("http://192.168.1.164:8080/wsdl/IComanda");
$obj = $client->Requisicao($gtData);
$xml = simplexml_load_string($obj);
print_r ($xml);
Only what I get is similar to this (example taken from PHP):
SimpleXMLElement Object
(
[title] => Forty What?
[from] => Joe
[to] => Jane
[body] =>
)
How do I view the pure XML received from web service?
Alysson, I think the browser that is omitting the tags. See how the return with the
header()
.– gmsantos
The error that appears in this code is this: error on line 1 at column 2: Starttag: invalid element name
– Alysson
I could test the following:
var_dump($obj);
?– gmsantos
I took header() and echo and did what you said. Perfect. That’s right, thanks man.
– Alysson