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.
intport=234;std::stringip="<Server IP address>";XmlRpcClientc(ip.c_str(),port);XmlRpcValuenoArgs,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:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.1200OKconnection:closecontent-length:329content-type:text/xmldate:Thu, 25 Nov 2010 13:10:43 GMTserver:libiqxmlrpc 0.8.9<?xmlversion="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>Servererror. XML-RPC violation: XML-RPC format violation at line 2</string></value></member></struct></value></fault></methodResponse>
Is iqxmlrpc being picky about something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Without delay or hesitation the program prints this to my terminal:
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
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.
Oh, sorry, I see you are using Windows. So its better to use Wireshark for you.
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:
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:
Is iqxmlrpc being picky about something?
By the way, "IGame.getActivePlayerName" returns a string and has no parameters.
Indeed it is bug in server library. It requires <params> tag always present. Which seems standard violation:
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.
Thank you very much.
I'll go see if I can make xmlrpc++ send the <params>.