?

Log in

No account? Create an account
A few days ago I posted a question about XML-RPC calls using… - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Sep. 21st, 2006|08:04 pm]
LiveJournal Client Discussions
lj_clients
[slinky_treecat]
A few days ago I posted a question about XML-RPC calls using Flash.  Despite several helpful suggestions I wasn't able to find a solution.. until today:

LJ's listing of what a "getchallenge" call should look like reads:

POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: www.livejournal.com
Content-Type: text/xml
Content-Length: 193

<?xml version="1.0"?>
<methodCall>
<methodName>LJ.XMLRPC.getchallenge</methodName>
<params>
<param>

</param>
</params>
</methodCall>



So, trying to emulate this in Flash I was building the following XML to send:

<?xml version="1.0"?><methodCall><methodName>LJ.XMLRPC.getchallenge</methodName><params><param /></params></methodCall>


Which threw a "failure during deserialization.  Array can't be set to a null value" or something to that effect.  After poking around and experimenting for a bit I came to the conclusion that the XML should be formatted like this:

<?xml version="1.0"?><methodCall><methodName>LJ.XMLRPC.getchallenge</methodName><params /></methodCall>

And VOILA!  It works.


I also found a very nice looking XML-RPC library written for ActionScript 2.0, which I plan to use rather than writing my own from scratch:

http://xmlrpcflash.mattism.com/

Hope that's helpful, if anyone else has been stuck on this... :)
linkReply