For PHP, we recommend the Pear package XML_RPC. You can download it at http://pear.php.net/package/XML_RPC/. It will handle the https connection transparently.
require_once("XML/RPC.php"); # PEAR::XML-RPC class
$login = "apilogin"; # username for API
$password = "apipassword"; # password for API
$key = "PLSK.00052355"; # key to retrieve
$url = "https://ka.parallels.com";
$port = 7050;
$functionName = "partner10.retrieveKey"
$AuthInfo["login"] = new XML_RPC_VALUE($login, "string");
$AuthInfo["password"] = new XML_RPC_VALUE($password, "string");
$functionParams[] = new XML_RPC_VALUE($AuthInfo, "struct");
$functionParams[] = new XML_RPC_VALUE($key, "string");
$message=new XML_RPC_Message($functionName,$functionParams);
$client = new XML_RPC_Client("/", $url, $port);
$result = $client->send($message);
$data = $result->value();
$dataArray = XML_RPC_decode($data);
if ($dataArray["resultCode"] == 100) {
Process data here!
echo $dataArray["key"]; # prints key
# print_r($dataArray); # print the entire array
} else {
echo "Result Code: ".$dataArray["resultCode"]."\n";
echo "Result Desc: ".$dataArray["resultDesc"].$dataArray["faultString"]."\n";
}
Now you can process the Key file, store it on a file system or in a database. Or directly install it in the software.