Log in

No account? Create an account
LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

Having problems with XMLRPC getchallenge [Jan. 4th, 2005|01:17 am]
LiveJournal Client Discussions


I'm writing an LJ library and client for .NET. My goal is to make the library as easy to use as possible.

I'm creating the XML by hand, posting it via System.Net.WebClient, which is an HTTP client class and has worked perfectly for all the other web access tools I've written - so I'm fairly sure it's not screwing anything up, and I've looked at the headers with a packet sniffer and they look right.

Here's the XML I generate and send:

<?xml version="1.0"?>


But I get this response:

<?xml version="1.0" encoding="UTF-8"?><methodResponse><fault><value><struct><member><name>faultString</name><value><string>Application failed during request deserialization: Can't use an undefined value as an ARRAY reference at /usr/share/perl5/SOAP/Lite.pm line 1667, <GEN7> line 605.

The packets and length counts look right and I can issue other calls like getfriends with clear auth, and it works perfectly.

Any clues would be helpful.

I'm also wondering if there's more documentation on the Event Properties. The documentation available is kind of confusing and inconsistent - it refers to properties which aren't documented.

[User Picture]From: marksmith
2005-01-04 06:12 pm (UTC)
I think your [params][param][/param][/params] section looks fishy. There's nothing in it? Shouldn't it just be [params][/params] then?
(Reply) (Thread)
[User Picture]From: vanbeast
2005-01-04 06:21 pm (UTC)
I think it's something else. The documentation (link) uses the same XML as an example, and I know it used to work...
(Reply) (Parent) (Thread)
[User Picture]From: thewerewolf
2005-01-04 06:28 pm (UTC)
The documentation is wrong. I removed the params/param block and now it works perfectly. No other changes. :)

In fact, the error I get makes sense - the XML parser isn't handling an empty data area correctly. Since it sees "params" and "param" it's expecting some kind of param data there, but isn't finding any.

It's possible this used to work, but some upgrade to the XMLRPC:Lite code has broken it.
(Reply) (Parent) (Thread)
[User Picture]From: vanbeast
2005-01-04 06:30 pm (UTC)
Oh awesome :) I am certain that it used to work, but yeah. An upgrade to SOAP::Lite probably brought it back into compliance.

(Reply) (Parent) (Thread)
[User Picture]From: marksmith
2005-01-04 06:36 pm (UTC)
Thanks for the heads up! I've updated the documentation in CVS, so it should be updated on the site in a few weeks at most.
(Reply) (Parent) (Thread)
From: kprevas
2005-09-11 06:39 am (UTC)
Just as another heads-up here, this documentation error is still present on the site.
(Reply) (Parent) (Thread)
[User Picture]From: thewerewolf
2005-01-04 06:31 pm (UTC)
You're right. However, I removed both the param and params pairs and it now works. I can try it again with just the params pair in place.

I think either the XMPRPC parser in the LJ code has changed and now the docs are wrong. I also suspect that prepackaged XMLRPC kits are smart enough to remove the params/param block if there's nothing in it, but since I'm hand coding these, I didn't know that was necessary.

But either way, it's working now. :)

Now what I need is more complete documentation for the Event Properties.
(Reply) (Parent) (Thread)
(Deleted comment)
[User Picture]From: thewerewolf
2005-01-04 07:14 pm (UTC)
I've looked through all the .NET libraries for both XMLRPC and for LJ and to be honest, they're all overwhelmingly complex and difficult to use.

My library is already very easy to use and hides most of the complex stuff away.

Mind you, some of this might be documentation issues - we'll see how easy mine is once someone other than myself tries to use it. :)

In this case, the XML generated was very rigid and predictable, so generating my own was trivial. The actual XML-RPC protocol is trivial, and WebClient handles the transport very easily.

This is the same reason I avoided using .NET's XML building libraries - toooo complicated for such a simple task. :)

But I am using their XML parser. I really don't want to write my own version of that.
(Reply) (Parent) (Thread)