?

Log in

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

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

LJ XML-RPC Query [Oct. 23rd, 2004|12:35 am]
LiveJournal Client Discussions

lj_clients

[kiranlightpaw]

Greetings!

First, my apologies if this question has been asked before. I scanned back over the entries as well as doing a Google on the subject, but I haven't been able to return no helpful information. I'm currently working on an XML-RPC based LJ client in Visual Basic 6, using the vbXMLRPC COM object. I've actually had a bit of success using it, but I've run into a problem. When I log into an account thas has "friendsgroups" defined, vbXMLRPC is able to parse the information fine. But when I log into an account that has no friends groups defined, vbXMLRPC complains about malformed XML.

[?xml version="1.0"?]
[methodCall]
  [methodName]LJ.XMLRPC.login[/methodName]
  [params]
    [param]
      [value]
        [struct]
          [member]
            [name]username[/name]
            [value]
              [string]littlerob[/string]
            [/value]
          [/member]
          [member]
            [name]password[/name]
            [value]
              [string]OMITTED[/string]
            [/value]
          [/member]
          [member]
            [name]getmenus[/name]
            [value]
              [i4]1[/i4]
            [/value]
          [/member]
        [/struct]
      [/value]
    [/param]
  [/params]
[/methodCall]

When I issue this call from an account that has friends groups, I have no problem logging in. The account above, though, has no friends groups created. When I call LJ.XMLRPC.login from within vbXMLRPC, I get an error stating: 'data' is empty, valid node is 'value'. At postion 280.

[?xml version="1.0" encoding="UTF-8"?]
[methodResponse]
[params]
[param]
[value]
[struct]
[member]
[name]userid[/name]
[value][int]2045002[/int][/value]
[/member]

[member]
[name]fullname[/name]
[value][string]littlerob[/string][/value]
[/member]

[member]
[name]friendgroups[/name]
[value][array][data/][/array][/value]
[/member]

[member]
[name]usejournals[/name]
[value][array][data/][/array][/value]
[/member]

[/struct]
[/value]
[/param]
[/params]
[/methodResponse]

Now, I've been using XML now for a grand total of two weeks, so my judgement is suspect and based mostly on observation, but [data/] doesn't look like valid XML. Surely this is not a problem with the LJ.XMLRPC since I assume many others here are using it. Am I looking at a problem with vbXMLRPC or something else entirely that I haven't thought of yet?

linkReply

Comments:
[User Picture]From: hythloday
2004-10-25 04:25 pm (UTC)
Assuming that by [data/] you mean <data/>, it is perfectly valid XML and is exactly the same as <data></data>.
(Reply) (Thread)
[User Picture]From: squiddity
2004-10-25 04:52 pm (UTC)
It is, nonetheless, compaining that the 'data' element is empty. Presumeably it is validating it according to some schema which requries that 'data' holds some elements?
(Reply) (Parent) (Thread)
[User Picture]From: kiranlightpaw
2004-10-25 06:09 pm (UTC)
I wonder if there's a way that I can change the validation schema vbXMLRPC is using. Unfortunately, I can't test anything until I get home from work tonight.

Has anyone else here successfully used vbXMLRPC.dll (the one from EnAppSys) or am I barking up the wrong tree?
(Reply) (Parent) (Thread)
[User Picture]From: kiranlightpaw
2004-10-25 06:08 pm (UTC)
As I said, I've been doing XML for two weeks now, so my judgement is suspect. :P
(Reply) (Parent) (Thread)
[User Picture]From: hythloday
2004-10-25 06:23 pm (UTC)
I have seen warnings in various XML articles about having to use <data /> instead of <data/> because of issues with some parsers - you might want to try that. I don't know what the easiest way to do it programmatically is, though - maybe try rewriting the XML stream with a SAX parser (that will get you <data></data>, which should parse for you fine)? That's the easiest way I can think of to do it.
(Reply) (Parent) (Thread)
[User Picture]From: griffology
2004-11-07 04:28 pm (UTC)
I just started researching using Visual Basic to make a LJ client. The documentation and information out there is very scarce. Are you using anything besides the vbXMLRPC?
(Reply) (Thread)