lczub / TestLink-API-Python-client

A Python client to use the TestLink API
104 stars 63 forks source link

XML RPC not working #73

Closed mazimkhan closed 7 years ago

mazimkhan commented 8 years ago

Hi

I have TestLink version 1.9.14 (Padawan). When I do an XML RPC request I get following error:

XML RPC request:
----------------

POST /testlink/lib/api/xmlrpc/v1/xmlrpc.php HTTP/1.1
Host: mytestlink.com
Accept-Encoding: gzip
User-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)
Content-Type: text/xml
Content-Length: 264

<?xml version='1.0'?>
<methodCall>
    <methodName>tl.countProjects</methodName>
    <params>
        <param>
            <value>
                <struct>
                    <member>
                        <name>devKey</name>
                        <value>
                            <string>devKey_copied_from_User_page</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

XML RPC Response
----------------

HTTP/1.1 200 OK
Date: Thu, 14 Jul 2016 09:22:18 GMT
Server: Apache/2.4.7 (Ubuntu)
Set-Cookie: PHPSESSID=bava9mt3uur0c72i3pq2e4fvv6; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-Length: 42
Connection: close
Content-Type: text/html; charset=UTF-8

XML-RPC server accepts POST requests only.
lczub commented 8 years ago

Hello Mohammad,

it seems, that you send directly a rpc method call countProjects to your TL server. This will confuse the TL server, because this method is not declared as an supported rpc api inside his php sources.

countProjects is a method only know by the python class TestlinkAPIClient, which send a getProjects RPC call to the TL server and evaluates the responds.

My suggestion is, please take a look into the example https://github.com/lczub/TestLink-API-Python-client/blob/master/example/TestLinkExample.py#L683 It shows, how you can initiate the python api client and communicate with the TL server.

Hope this helps, Regards Luiko

The supported xml rpc call getProjetcs looks like `<?xml version='1.0'?>

tl.getProjects devKey 007

`

lczub commented 7 years ago

Closed cause no additional user comment