revjim.net Rotating Header Image

PEAR::XML_RPC_Server errors

If you're using PEAR's XML_RPC_Server and are receiving errors with
your non-PHP client, there's a reason why. There's a bug in
XML_RPC_Server, that, many clients simply ignore. However, some clients,
in particular xmlrpc-c for C have
big issues with this. When using this particular client, the error "-503
Unclosed Token" is received.

It's easy to fix. Open up pear/XML/RPC/Server.php. Search for the
text "Content-length" without the quotes, case sensitive. In my file
it's on line 184. Replace that line and the line that follows it with
the following:

header('Content-Length: ' . strlen($payload));
header('Content-Type: text/xml');

I hope that keeps you from running into the same trouble that I
had.

Share and Enjoy:
  • Facebook
  • StumbleUpon
  • Digg
  • del.icio.us
  • Google
  • Reddit
  • Technorati
  • Furl
  • Spurl
  • Live
  • Pownce
  • TwitThis