#44 XMLRPC response(true) fails to close fault tag

Apennine_Services
open
nobody
None
5
2012-11-18
2007-07-27
Anonymous
No

The XML produced by the response(true) is not well-formed. It is missing </fault> before </methodResponse>

Code snippet:

class MyXmlRpc: public ost::XMLRPC
{
public:
MyXmlRpc()
{}

void fault(long int code, std::string& msg) {
response(true);
begStruct();
addMember("faultCode", code);
addMember("faultString", msg.c_str());
endStruct();
}

....
};

xml produced:

<?xml version="1.0"?>
<methodResponse>
<fault>
<struct><value>
<member><name>faultCode</name>
<value><i4>14</i4></value></member>
<member><name>faultString</name>
<value><string>Too many parameters</string></value></member>
</struct></value>
</methodResponse>

Discussion

  • Example program to demonstrate the bug

     
    Attachments
  • Logged In: NO

    The final </struct></value> should really be </value></struct> (or, </value></struct></fault>)

     
  • Logged In: NO

    Doesn't happen in 1.5:

    <?xml version="1.0"?>
    <methodResponse>
    <fault>
    <value><struct>
    <member><name>faultCode</name>
    <value><i4>14</i4></value></member>
    <member><name>faultString</name>
    <value><string>Too many parameters</string></value></member>
    </struct></value>
    </fault>
    </methodResponse>

     
  • David Sugar
    David Sugar
    2012-11-18

    All xmlrpc support has moved to the apennine codebase and is structured a little differently. This needs to be reviewed...

     
  • David Sugar
    David Sugar
    2012-11-18

    • milestone: Common_Libraries --> Apennine_Services