There are a number of things wrong with this code. Most of the LimeLM API functions take scalar information, not arrays. For instance, you're doing this:
$api_data['method'] = 'test';$api_data['api_key'] = $api_key;$result = LimeLM::SetAPIKey($api_data);
Which is passing an array of data when it should just be string:
$result = LimeLM::SetAPIKey($api_key);
Ditto for GetPKeyDetails. Again you're passing an array of garbage when you should be looking at the function definition in LimeLM.php to see what's needed:
public static function GetPKeyDetails($pkey_id)
This means, just pass in the pkey_id to the GetPKeyDetails() function:
$result = new SimpleXMLElement(LimeLM::GetPKeyDetails('123456'));
How do you turn the product key ''4W..-....-....-....-....-....-...." into a pkey_id? Well, again, there's a function for that. It's called GetPKeyID(). It takes a $version_id and a $pkey
GetPKeyID('100', '4W..-....-....-....-....-....-....');
Does that make sense?