?

Log in

No account? Create an account
Implementing XML-RPC - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

Implementing XML-RPC [Jun. 25th, 2002|11:03 pm]
LiveJournal Client Discussions

lj_clients

[kid_icarus75]
In my attempt to create an XML-RPC based LJ client I came across a problem: No matter what I post to the server I always get a "XML-RPC Fault #200: Client error: Missing required argument(s)".

I've been using the reference located here: http://goathack.livejournal.org:8006/doc/hack/r257.html

If I am correct, all I need to pass is a xmlrpcval structure holding an xmlrpcval value for the username and an xmlrpcval for the password.

No luck.

Any ideas, or even a link to working XML-RPC client in any language would be helpful.

PS: It would be nice if the LJ Server provided XML-RPC introspection support to help with this.
linkReply

Comments:
[User Picture]From: jproulx
2002-06-25 10:25 pm (UTC)
(Reply) (Thread)
[User Picture]From: kid_icarus75
2002-06-25 10:59 pm (UTC)
no luck... still not enough arguments for login and other methods?
(Reply) (Parent) (Thread)
From: indif69
2002-06-27 12:48 pm (UTC)

Well, this is what I am sending to the server. I'm writing a client too for XMLRPC. I got the same error you describe when I didn't sent the <params> and <param> tags.

<?xml version="1.0" encoding="utf-8" ?>
<methodCall>
<methodName>LJ.XMLRPC.login</methodName>
<params>
<param>
<struct>
<member>
<name>username</name>
<value>indif69</value>
</member>
<member>
<name>password</name>
<value>----</value>
</member>
</struct>
</param>
</params>
</methodCall>

(Reply) (Thread)
[User Picture]From: kid_icarus75
2002-06-27 01:47 pm (UTC)
Thank you!

It turned out my error was in my XML handling code and not with livejournal. I was forming the param and params tags wrong like you said.
(Reply) (Parent) (Thread)
[User Picture]From: hass0002
2002-08-23 02:40 pm (UTC)

Which socket?

Hi,
What are you creating your connection on? Are you connecting to www.livejournal.com on port 80? I'm having some problems and thinking that this might be the problem. Thanks.
(Reply) (Parent) (Thread)
[User Picture]From: kid_icarus75
2002-08-23 03:16 pm (UTC)

Re: Which socket?

i did all my xmlrpc in php. i opened a socket to www.livejournal.com/interface/xmlrpc on port 80. my problems were all caused by malformed param tags. i hope this info helps at all.
(Reply) (Parent) (Thread)
From: indif69
2002-08-24 08:15 am (UTC)

Re: Which socket?

Yes, I am, and the error above was intentional because I want my client to be able to handle errors. What language are you programming in?
(Reply) (Parent) (Thread)
[User Picture]From: hass0002
2002-08-24 01:51 pm (UTC)

Re: Which socket?

I'm using Java. I keep getting an error called "Invalid page fault." I think it has to do with how I'm sending the arguments or something small like that. What language are you using? Maybe I could look at some code for how to you are calling login or postevent and maybe I'll see what my problem is. Thanks.
(Reply) (Parent) (Thread)
From: indif69
2002-08-24 02:12 pm (UTC)

Re: Which socket?

I use C#.NET myself, and with respect to web requests, it is quite different. However, this is my code. I don't know if it'll be of any use to you.

System.Net.HttpWebRequest req = (System.Net.HttpWebRequest) System.Net.WebRequest.Create(server.url);
req.ContentType = "text/xml";
req.Method = "POST";

this.mstream.Position = 0;
System.IO.StreamReader reader = new System.IO.StreamReader(this.mstream, System.Text.Encoding.UTF8);

string body = reader.ReadToEnd();
req.ContentLength = body.Length;

System.IO.StreamWriter writer = new System.IO.StreamWriter( req.GetRequestStream() );
writer.Write( body );
writer.Close();

WebResponse response = req.GetResponse();

if (response == null)
{
throw new ApplicationException("The server did not respond to the client");
}


System.IO.StreamReader sr = new System.IO.StreamReader( response.GetResponseStream() );
string result = sr.ReadToEnd();
Console.WriteLine(result);
sr.Close();

return new zbj.backend.xresponse(result);
(Reply) (Parent) (Thread)
[User Picture]From: hass0002
2002-08-24 02:15 pm (UTC)

Re: Which socket?

Hi,
I just figured out what the problem was. I'm an idiot and I misspelled LJ.XMLRPC.postevent with LJ.XMLPRC.postevent. And I kept cutting and pasting that part. But I got it down now, so I can continue with it now. Thanks.
(Reply) (Parent) (Thread)