?

Log in

No account? Create an account
A little XML-RPC hand holding please - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

A little XML-RPC hand holding please [Sep. 24th, 2003|04:36 pm]
LiveJournal Client Discussions

lj_clients

[oosabeansaladen]
I'm having difficulty figuring out how to programmatically build the parameter structure using Java and XML-RPC. I'm using org.apache.xmlrpc I'd like to see what code I need to write if I just want to login to LJ. I figured this much:
XmlRpcClient xmlrpc = new XmlRpcClient("http://www.livejournal.com:80/interface/xmlrpc");

XmlRpcClient's method to call procedures is
public Object execute(String method, Vector params)

If I want to login to my LJ account, LJ's XML-RPC API specifies that I have to use a struct of key/value pairs for the params. However, the Vector structure does not have keys... only values. So I'm kind of at a loss on what to do. How do you populate the vector with the right values? and how do you retreive the values from the returned Object when, say, the login procedure returns?
linkReply

Comments:
[User Picture]From: oosabeansaladen
2003-09-25 08:45 am (UTC)

Re: why XML RPC?

I'm using Sun's JDK 1.4.2

The screenshot you see above is all written in Java using the SWT GUI toolkit. None of the Semagic code was used.

In case you don't know, SWT is a toolkit developed by IBM which uses the OS's native widgets to render the UI. The library detects whatever platform it's running on and uses the Win32 API on Windows, GTK2 on Linux and Cocoa on OS X (I think). It's much faster and uses less memory that SWING or AWT.

See this site for more info:
http://www.eclipse.org
(Reply) (Parent) (Thread)
[User Picture]From: quirrc
2003-09-26 01:29 am (UTC)

Re: why XML RPC?

i forgot that you said you wanted to study programming. i whouldn't do something that was already done except if i wanted to study. (Actually I wrote programs from the beginning only when i was like 12 yo, now i mostly modify parts written by others especially because i do scientific programming).
In your place if i wanted to write a client (if the primary goal is not iterplatform compatibility) i whould have used parts already written and add written by me in java or any other language, this whould give also experience with multu-language linking.
(Reply) (Parent) (Thread)
[User Picture]From: oosabeansaladen
2003-09-26 08:21 pm (UTC)

Re: why XML RPC?

Well I'm already gonna get some multi-language linking experience because SWT doesn't support all the features I want to implement. For example, there's no support for tray icons in SWT so I'm gonna do my own C or C++ library to implement this for each platform.

I don't really feel like reusing parts of other projects since I would lose an opportunity to learn new things by having to implement them myself.

BTW, if I ever release my project to the public, it's not gonna be called Sema-J or anything close to the Semagic name. And I'm gonna change the GUI so that people don't think it's your project they are using. Just so that people don't get confused.
(Reply) (Parent) (Thread)