Alister (alister) wrote in lj_dev,
Alister
alister
lj_dev

XML-RPC interface

Is anyone else using the XML-RPC interface to LiveJournal?

The program (below) returns with a 'HTTP/1.1 500 Internal Server Error' with this error payload:

On my local test server I get:
faultString: Denied access to method (getdaycounts) in class (main) at /usr/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 1936.
faultCode: Client

Going to livejournal.com itself, gets much the same:
faultString: Denied access to method (getdaycounts) in class (main) at /usr/share/perl5/SOAP/Lite.pm line 2113.
faultCode: Client

function getdaycounts is in the package/class LJ::Protocol (cgi-bin/ljprotocol.pl)l - not main::.


<?php
  include_once("xmlrpc/xmlrpc.inc");
  // Create a new XML-RPC client instance
  $client = new xmlrpc_client('/interface/xmlrpc', "www.livejournal.com", 80);

  $getDatCountsData = new xmlrpcval(  array(
        "user" => new xmlrpcval("alister", "string"),
        "password" => new xmlrpcval('fakepassword', "string"),
        "hpassword" => new xmlrpcval(md5('fakepassword'), "string"),
      ),
      "struct"
    );

  // Create a new XML-RPC message instance
  $msg = new xmlrpcmsg('getdaycounts', array($getDatCountsData));
  
  // Send our XML-RPC message to the server and receive a response in return
  $response = $client->send($msg);

      // (check/show errors)
  if ($response->faultCode())
  {
      echo "Fault: ";
      echo "Code: " . $response->faultCode() .
            " Reason '" .$response->faultString()."'
"; #print_r($response); exit; }
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 5 comments