Read/write Testlink content with C# possibilities??
Moderators: Amaradana, TurboPT, TL Developers
Re: Read/write Testlink content with C# possibilities??
use XML-RPC API provided by TL
Re: Read/write Testlink content with C# possibilities??
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);
}
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);
}
Re: Read/write Testlink content with C# possibilities??
and then?
what do you expect people do with your code ?
what do you expect people do with your code ?
Re: Read/write Testlink content with C# possibilities??
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.
I think that my post constitute a start point.
If you have a complete sample in c# (nor C++), I'm also interested.
-
- TestLink user
- Posts: 2
- Joined: Mon Feb 14, 2011 1:44 pm
Re: Read/write Testlink content with C# possibilities??
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
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
Re: Read/write Testlink content with C# possibilities??
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
2. phpdoc documentation is not updated => open our php server code and read method comments that are normally updated