urlstr = $urlstr; } function execute($func, $args) { $ctx = stream_context_create(array('http' => array( 'method' => 'POST', 'header' => 'Content-Type: text/xml', 'content' => xmlrpc_encode_request($func, $args) ))); return xmlrpc_decode(file_get_contents($this->urlstr, false, $ctx)); } } $cli = new Client('http://localhost:8001/'); $msgs = $cli->execute('S.process', array('Hi from PHP!')); foreach($msgs as $msg) { echo "$msg\r\n"; } ?>