Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001806TestLinkAPI - XMLRPCpublic2008-10-18 09:312015-05-15 12:12
Reporterbmahe 
Assigned Tofman 
PrioritynormalSeverityfeature requestReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version1.8 Beta 3 
Fixed in Version 
Summary0001806: Contribution: lib/api/xmlrpc.php does not send regular XML-RPC error messages
Descriptionlib/api/xmlrpc.php defines errors as an array of errors but the third party library xml-rpc does not handle lists of errors.
And even if it would, I doesn't seem to be allowed in the XML-RPC protocol (see the first bullet in updated 1/21/99 DW at http://www.xmlrpc.com/spec [^])

So when an error occurs, instead of sending an error message which looks like :
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><int>{$this->code}</int></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>{$this->message}</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

It will send a regular message containing a fault code and fault string attribute.


You will find a patch attached to this ticket fixing this issue.
Additional InformationYou can read in third_party/xml-rpc/class-IXR.php:298 :
        $result = $this->call($this->message->methodName, $this->message->params);
        // Is the result an error?
        if (is_a($result, 'IXR_Error')) {
            $this->error($result);
        }

When an error occurs $result will be an array of IXR_Error and thus wouldn't match the error detection condition.

This patch makes TestlinkXMLRPCServer storing only one error at a time and returning an IXR_Error instance.
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browser
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Filespatch file icon xmlrpc.patch [^] (15,946 bytes) 2008-10-18 09:31 [Show Content]
? file icon xmlrpc.php [^] (51,398 bytes) 2008-10-22 23:12
txt file icon strings.txt [^] (63,716 bytes) 2008-10-22 23:13 [Show Content]

- Relationships

-  Notes
(0005446)
bmahe (reporter)
2009-02-13 09:42

Has anyone been able to reproduce it ?
(0023309)
Mr.Bricodage (updater)
2015-05-03 13:31
edited on: 2015-05-03 13:40

- TestLink 1.9.14 dev still provide error message through array (done with sample_client\php\clientGetTestCaseIDByName.php)

<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>code</name><value><int>2000</int></value></member>
<member><name>message</name><value><string>(getTestCaseIDByName) - Can not authenticate client: invalid developer key</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodResponse>

<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<array><data>
<value><struct>
<member><name>code</name><value><int>5030</int></value></member>
<member><name>message</name><value><string>(getTestCaseIDByName) - Cannot find matching test case. No testcase exists with the name provided!</string></value></member>
</struct></value>
</data></array>
</value>
</param>
</params>
</methodResponse>

- XML-RPC specification has not been changed since 2003. The defined format for error message is :
<?xml version="1.0"?>
<methodResponse>
   <fault>
      <value>
         <struct>
            <member>
               <name>faultCode</name>
               <value><int>4</int></value>
               </member>
            <member>
               <name>faultString</name>
               <value><string>Too many parameters.</string></value>
               </member>
            </struct>
         </value>
      </fault>
   </methodResponse>

(0023315)
fman (administrator)
2015-05-03 17:09

I'm going to try to have more info, but IMHO application has to be free to provide error as it wants

- Issue History
Date Modified Username Field Change
2008-10-18 09:31 bmahe New Issue
2008-10-18 09:31 bmahe File Added: xmlrpc.patch
2008-10-18 23:19 fman Status new => assigned
2008-10-18 23:19 fman Assigned To => fman
2008-10-22 23:12 bmahe File Added: xmlrpc.php
2008-10-22 23:13 bmahe File Added: strings.txt
2009-02-13 09:42 bmahe Note Added: 0005446
2013-04-25 17:30 fman Category TL API => XMLRPC API
2013-04-25 17:30 fman Category XMLRPC API => API - XMLRPC
2015-05-03 13:31 Mr.Bricodage Note Added: 0023309
2015-05-03 13:40 Mr.Bricodage Note Edited: 0023309 View Revisions
2015-05-03 17:09 fman Note Added: 0023315



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker