Cortex - Sample XML-RPC client

<?php
set_time_limit(0);
$post_url = 'http://<your-ip-address>:8365/xmlrpc.php?xml=';

//specify the method we are calling
$method = 'method_name';

// create parameter array
$params = array('mypass', // Cortex password - REQUIRED
1, // server id - REQUIRED
// more params...
);

// encode xmlrpc request
$xml_request = xmlrpc_encode_request($method,$params);

// make the request
$response = @file_get_contents($post_url.urlencode(substr($xml_request,strpos($xml_request,"\n")+1)));

if (!$response) { // failed
echo 'unable to execute xmlrpc request';
} else {
$result = xmlrpc_decode($response);

if (isset($result['Exception'])) {
die($result['Exception']);
} else {
if ($result) {
echo 'Success!';
}
}
}
?>