When connecting to the Wordtracker XML-RPC server you may receive an error message or the results may not be what was expected. In this case it can be helpful to see what was passed from your client to our server and what was returned. These are referred to as XML-RPC packets. Most problems can be resolved by studying these packets. There are two approaches to obtaining this information, the first is to use the built in commands of the XML-RPC library to report the packets. The second approach is to use a packet sniffer.
XML-RPC libraries often provide mechanisms for displaying the packets. Here is an example using the Incutio PHP library.
require_once('IXR_Library.inc.php');
$client = new IXR_Client('http://test.xmlrpc.wordtracker.com');
$client->debug = 1;
if (! $client->query('ping', 'guest')) {
print 'Procedure returned error message: ' . $client->getErrorMessage() . '.';
}
if ($client->getResponse() !== true) {
print 'The procedure returned an incorrect result.';
}
print 'Successfully pinged test account.';
This should produce the output:
POST / HTTP/1.0 Host: test.xmlrpc.wordtracker.com Content-Type: text/xml User-Agent: The Incutio XML-RPC PHP Library Content-length: 149 <?xml version="1.0"?> <methodCall> <methodName>ping</methodName> <params> <param><value><string>guest</string></value></param> </params>< /methodCall> <?xml version="1.0" encoding="utf-8" ?> <methodResponse> <params> <param><value> <boolean>1</boolean> </value></param> </params> </methodResponse>
The "methodCall" element is the packet sent to the XML-RPC server. The "methodResponse" element is the packet returned to the client.
The Incutio site http://scripts.incutio.com/xmlrpc/ provides further information and documentation.
Please refer to the documentation of your particular library for information on how to report the packets. If you're unable to find this information, another method is to use a packet sniffer.