<?php

$opt = array('location' => 'http://localhost/soap-server.php', 'uri' => 'http://localhost/');
$api = new SoapClient(NULL, $opt);
echo $api->helloworld();
echo "<br>";
echo $api->addition(2, 3);
echo "<br>";
echo $api->getData();
Example #2
0
<?php

try {
    $arguments = array();
    $arguments['encoding'] = 'UTF-8';
    $arguments['exceptions'] = true;
    $arguments['location'] = 'http://git/phpoo/soap.php?class=PessoaServices';
    $arguments['uri'] = "http://test-uri/";
    $arguments['trace'] = 1;
    // cria o client
    $client = new SoapClient(NULL, $arguments);
    print_r($client->getData(19));
} catch (Exception $e) {
    echo $e->getMessage();
}