Kuddi: Struct/array return types

"Kevin O'Rourke" <[email protected]> Mon, 18 Nov 2002 20:56:55 +0000
Newsgroups gmane.comp.java.enhydra.kxmlrpc
Message-ID <[email protected]>
Hi,

sorry if this ends up as a duplicate post, I sent the last one from the wrong 
address so it is awaiting moderation.

I've just started using kXML-RPC in an attempt to write a Blogger XML-RPC 
client that will run on phones and PalmOS devices.

The basic stuff mostly seems to work but I'm having problems with complex 
return values from remote methods. For a start the documentation isn't very 
clear what type of object I should expect as a return value.

For example the method blogger.getUsersBlogs returns an array of structs.  
What does kXML-RPC return in this case?  Will it be an array of some kind of 
special objects?

Also, when I try the blogger.getUsersBlogs method kXML gives me a 
ParseException with this stack trace:
org.kxml.io.ParseException: unexpected: StartTag <data> line: -1 attr: null 
@-1:-1
        at org.kxml.parser.AbstractXmlParser.read(+53)
        at org.kxmlrpc.XmlRpcParser.parseValue(+15)
        at org.kxmlrpc.XmlRpcParser.parseArray(+23)
        at org.kxmlrpc.XmlRpcParser.parseValue(+241)
        at org.kxmlrpc.XmlRpcParser.parseParams(+46)
        at org.kxmlrpc.XmlRpcParser.parseResponse(+144)
        at org.kxmlrpc.XmlRpcClient.execute(+200)
        at MEblog.getBlogs(+59)
        at MEblog.commandAction(+36)
        at 
javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+152)
        at com.sun.kvem.midp.lcdui.EmulEventHandler$EventLoop.run(+459)

The returned data is:
<?xml version="1
.0" encoding="UT
F-8"?><methodRes
ponse><params><p
aram><value><arr
ay><data><value>
<struct><member>
<name>url</name>
<value><string>h
ttp://orourke.ca
boose.org.uk/</s
tring></value></
member><member><
name>blogid</nam
e><value><string
>2</string></val

(apologies for the formatting, it's copied straight from the J2ME network 
monitor)  The response seems to have been truncated, content-length is 
specified as 421 but only 255 bytes appear in the network monitor, don't know 
if this is the cause of the ParseException or caused by it.

In fact the truncation looks suspiciously like something somewhere only allows 
256 characters per line, as the response is all one line.

This behaviour is reproducible.

Any ideas?

Kevin.

-- 
Kevin O'Rourke
http://www.caboose.org.uk