<html>
<body>
<pre>
<?php
error_reporting(E_ALL);
try{
$client = new SoapClient('http://w3net.eu/code/soap/test/php_server/service.wsdl', array(
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL
));
// string
$ret = $client->test();
echo '$ret = \''. $ret->response ."'\n<br>";
echo var_dump($ret) ."\n<br>";
echo "\n<hr>\n";
// array
$ret = $client->testArray();
if (!is_null($ret)){
if (is_array($ret)){
var_dump($ret);
}
}
// array of arrays
echo "\n<hr>\n";
$ret = $client->testArrayOfArrays();
echo var_dump($ret) ."\n<br>";
// array of objects
echo "\n<hr>\n";
$ret = $client->testArrayOfStructs();
echo '$ret->Customers[0]->Name = '. $ret->Customers[0]->Name ."\n\n<br>";
echo var_dump($ret) ."\n<br>";
} catch (SoapFault $exception) {
if (stristr($exception->faultstring,'Couldn\'t load from'))
die("Error: Your computer must be connected to the Internet. Connect to the Internet and try again.");
else
die('Error: '. $exception->faultstring);
}
?></pre></body></html>