access the testlink database by running a PHP from CLI

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
abadve
TestLink user
Posts: 13
Joined: Wed Feb 18, 2009 1:56 am

access the testlink database by running a PHP from CLI

Post by abadve »

Hello all
I am trying this simple example from the command line interface to access the testlink database. This example below works if I specify the absolute path to the location of class-IXR.php file. If I specify it using IP address it does not work.
Do I need some HTTP packages installed or am I having some permission problems.
<?php
require_once('http://IP_address/testlink/third_party/xml-rpc/class-IXR.php');
// above works if used absolute path
define("SERVER_URL", "http://IP_address/testlink/lib/api/xmlrpc.php");
define("DEV_KEY", "97b98d32b515fc4f2c9a09abf6999849");
$client = new IXR_Client(SERVER_URL);
if(!$client->query('tl.sayHello')) {
echo "callfailed". $client->getErrorCode()."-".$client->getErrorMessage();
}
else {
print "class called\n";
print($client->getResponse());
}
?>

I look forward to your replies.

Thanks a lot.
tfeathers
Advanced user
Posts: 19
Joined: Thu Mar 19, 2009 1:19 pm

Post by tfeathers »

The answer is use the python client... I will attach my code once I am done with it... I have one last piece to finish in the morning.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

the answer is undertand why php client do not work and solve
aksinghv
Advanced user
Posts: 57
Joined: Sun Aug 17, 2008 4:06 am

Post by aksinghv »

Hi tfeathers,

I guess your coding is complete. Could you share your code so that wider comunity gets benefitted.

Regards,
Anjani
Post Reply