SOAP Server w/PECL::SOAP
<?php
class filesystem {
    function ls($dir)
    {
        return shell_exec("ls ".$dir);
    }
}

// PECL::SOAP
$server = new SoapServer(null, array('uri' => 'http://example.php/'));
$server->setClass('filesystem');
$server->handle();
?>
SOAP Client w/PECL::SOAP
<?php
$client = new SoapClient(null, 
    array(
        'location' => "http://127.0.0.1/soap_server.php",
        'uri'      => "http://example.php/"
    )
);
$dir = new SoapParam("/vmlinu*", "dir");
echo nl2br($client->ls($dir));
?>
Output