Professor Mass ([info]professormass) wrote in [info]lj_dev,
@ 2008-06-16 03:43:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood:annoyed

editfriends XML-RPC issue.
Hi!

I'm trying to get my PHP-based XML-RPC client update friends' lists using the editfriends method, but I'm getting an odd response. Here's my PHP code:




require('Configuration/Configuration.php');
require($FunctionRoot . 'xmlrpc.php');

// LJ XML-RPC Variables
$add = array();
$add['username'] = 'user_to_be_friended';
$add['fgcolor'] = '#00688B';
XMLRPC_prepare($add,'struct');

$array = array();
$array['username'] = 'professormass';
$array['password'] = 'my_password';
$array['add'] = $add;

XMLRPC_prepare($array,'struct');

$result = XMLRPC_request('www.livejournal.com','/interface/xmlrpc','LJ.XMLRPC.editfriends', array($array));




I get this response:



Application failed during request deserialization: wrong element 'username'



Virtually the exact same code works for using the postevent method. Anybody have any clues on this one?


(Post a new comment)


[info]jamoche
2008-06-16 11:00 pm UTC (link)
Don't know PHP, but it looks like it wants an array of structs, and what you're giving it is just a struct.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…