Read/write Testlink content with C# possibilities??

Discussion and information for XML-RPC interface.

Moderators: Amaradana, TurboPT, TL Developers

Post Reply
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Read/write Testlink content with C# possibilities??

Post by fman »

use XML-RPC API provided by TL
denjolras
TestLink user
Posts: 12
Joined: Wed Dec 08, 2010 2:25 pm

Re: Read/write Testlink content with C# possibilities??

Post by denjolras »

Here are the steps I've follow to get xml-rpc :

download version "stable" from SVN
http://xmlrpc-c.svn.sourceforge.net/svn ... c-c/stable

Execute
xmlrpc-c\stable\Windows\ConfigureWin32.bat

compile xmlrpc-c\stable\Windows\xmlrpc.dsw

Use the includes from xmlrpc-c\stable\include\xmlrpc-c

After this, my C++ program start with instructions like :


xmlrpc_c::clientSimple myClient;

TheParams["devKey"] = xmlrpc_c::value_string("e83fa4abcdefghijklmnop1775b86d72");

xmlrpc_c::paramList paramList;
paramList.add(xmlrpc_c::value_struct(TheParams));

xmlrpc_c::value QueryTL_Result;
myClient.call(serverUrl, "tl.getProjects",paramList,&QueryTL_Result);
if ( QueryTL_Result.cValueP == NULL )
{
MessageBox(0,"QueryTL_Result is NULL","Error",MB_ICONERROR);
return -1;
}

// TestLink Results can be Arrays
if ( QueryTL_Result.type() == xmlrpc_c::value::TYPE_ARRAY )
{
// Cast in "vector"
xmlrpc_c::value_array QueryTL_Array_Result = xmlrpc_c::value_array(QueryTL_Result);
vector<xmlrpc_c::value> const Query_Result(QueryTL_Array_Result.vectorValueValue());

// Iterate

std::vector<xmlrpc_c::value>::const_iterator it1;
for( it1=Query_Result.begin() ; it1 != Query_Result.end(); ++it1 )
{
xmlrpc_c::value TheValue_Generic=(xmlrpc_c::value_struct)*it1;

ASSERT ( TheValue_Generic.type() == xmlrpc_c::value::TYPE_STRUCT);

xmlrpc_c::value_struct TheValue_Struct=(xmlrpc_c::value_struct)TheValue_Generic;

int res = ProceedStruct(TheValue_Struct,The_List,FromSubStruc);

}
}
if ( QueryTL_Result.type() == xmlrpc_c::value::TYPE_STRUCT )
{
xmlrpc_c::value_struct TheValue_Struct=(xmlrpc_c::value_struct)QueryTL_Result;
int res = ProceedStruct(TheValue_Struct,The_List,FromSubStruc);
}
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Read/write Testlink content with C# possibilities??

Post by fman »

and then?
what do you expect people do with your code ?
denjolras
TestLink user
Posts: 12
Joined: Wed Dec 08, 2010 2:25 pm

Re: Read/write Testlink content with C# possibilities??

Post by denjolras »

csharp_user was looking for a code sample...

I think that my post constitute a start point.

If you have a complete sample in c# (nor C++), I'm also interested.
csharp_user
TestLink user
Posts: 2
Joined: Mon Feb 14, 2011 1:44 pm

Re: Read/write Testlink content with C# possibilities??

Post by csharp_user »

OK, I have following schedule in my mind. Correct me if I'm wrong:
I found a "CookComputing.XmlRpcV2.dll". I'll have to include this file in my C# project. Then through the file's methods I connect to the XAMPP-server where TestLink is running on. On "http://testlink.org/api/phpdoc_generate ... erver.html" there are methods for TestLink, which i can type in my project code. Then the commands are wrapped by the DLL and sent as XML to TestLink. TestLink runs the command and send the results back also as a XML-file. Then I only have to transfer the data in my requested format.
Am I right?
PS:
Why has my first post been deleted??

greetings
Mr Sharp
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Re: Read/write Testlink content with C# possibilities??

Post by fman »

1. your post was deleted by error while trying to delete nasty postings.
2. phpdoc documentation is not updated => open our php server code and read method comments that are normally updated
Post Reply