Menu

faultcode:-32600

Help
Vexorum
2010-11-25
2013-04-24
  • Vexorum

    Vexorum - 2010-11-25

    Hi,

    I'm working on a GUI for a game. The game works via an XML-RPC server, so I thought I'd use this lib to connect to it. I've set up a project in VS2008 and built a C++ console app with the library.

    Here's the code.

        int port = 234;
        std::string ip = "<Server IP address>";
        XmlRpcClient c(ip.c_str(), port);
        XmlRpcValue noArgs, result;
        if (c.execute("IGame.getActivePlayerName", noArgs, result))
        {
            std::cout << "SERVER says OK: " << result << std::endl;
        }
        else
        {
            std::cout << "SERVER don't like: " << result << std::endl;
        }
    

    Without delay or hesitation the program prints this to my terminal:

    SERVER says OK: [faultCode:-32600,faultString:Server error. XML-RPC violation: XML-RPC format violation at line 2]
    

    I've looked up the fault code:
    -32600 --> server error. invalid xml-rpc. not conforming to spec.

    My theory is that somehow, the library is not producing proper XML-RPC requests. Have you seen anything like this problem? How can I test where and what the problem is?

    Any help would be appreciated.

    Kind regards,
    -Vex

     
  • Anton Dedov

    Anton Dedov - 2010-11-25

    Hi Vex.

    According to error message, server uses mine XML-RPC library. So it is either bug in xmlrpc++ or in libiqxmlrpc. I would suggest to catch request either with tcpdump or with netcat utility.  Netcat may emulate server with -l -p <port> options, so you can capture request.

    Please do that and place it here or send directly to me.

     
  • Anton Dedov

    Anton Dedov - 2010-11-25

    Oh, sorry, I see you are using Windows. So its better to use Wireshark for you.

     
  • Vexorum

    Vexorum - 2010-11-25

    Hi Adedov, thanks for the quick response.

    I am actually wireshark-ing as we speak. As best as I can tell, the client is sending this:

    POST /RPC2 HTTP/1.1
    User-Agent: XMLRPC++ 0.7
    Host: 77.248.99.73:234
    Content-Type: text/xml
    Content-length: 102
    <?xml version="1.0"?>
    <methodCall><methodName>IGame.getActivePlayerName</methodName>
    </methodCall>
    

    I know the function "IGame.getActivePlayerName" exists and works. (I have another program in C# that calls this on the server. It works.) I've caught the server's reply and it is this:

    HTTP/1.1 200 OK
    connection: close
    content-length: 329
    content-type: text/xml
    date: Thu, 25 Nov 2010 13:10:43 GMT
    server: libiqxmlrpc 0.8.9
    <?xml version="1.0" encoding="utf-8"?>
    <methodResponse><fault><value><struct><member><name>faultCode</name><value><i4>-32600</i4></value></member><member><name>faultString</name><value><string>Server error. XML-RPC violation: XML-RPC format violation at line 2</string></value></member></struct></value></fault></methodResponse>
    

    Is iqxmlrpc being picky about something?

     
  • Vexorum

    Vexorum - 2010-11-25

    By the way, "IGame.getActivePlayerName" returns a string and has no parameters.

     
  • Anton Dedov

    Anton Dedov - 2010-11-25

    Indeed it is bug in server library. It requires <params> tag always present. Which seems standard violation:

    If the procedure call has parameters, the <methodCall> must contain a <params> sub-item. The <params> sub-item can contain any number of <param>s, each of which has a <value>.

    However, most libraries include <params> tags even if there are no parameters (I've just checked python's standard library). Thats why it was not discovered yet. Also, our company used patched version of xmlrpc++ that among other fixes, make library to send <params> for every request.

    I guess this is easiest way for you this time - patch xmlrpc++. I will fix it on my side but hardly game guys will adopt fixed version that fast.

     
  • Vexorum

    Vexorum - 2010-11-25

    Thank you very much.
    I'll go see if I can make xmlrpc++ send the <params>.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.