- var_dump: documentation ( source)
- simplexml_load_string: documentation ( source)
- json_encode: documentation ( source)
<?php
$client = new SoapClient("http://www.scottnichol.com/samples/hellowsdl2.php?wsdl&debug=1",array(
"trace"=>1));
$obj = $client->hello(array('firstname'=>"Scott",'age'=>"50",'gender'=>"M"));
$xml = simplexml_load_string($client->__getLastRequest());
$json= json_encode($xml);
var_dump($xml);
echo "<BR>";
var_dump ($json);