Re: Issue 19 in android-xmlrpc: Support for <nil/> value extension to the XML-RPC spec?

32 views
Skip to first unread message

android...@googlecode.com

unread,
Nov 19, 2010, 9:57:23 AM11/19/10
to android-x...@googlegroups.com

Comment #1 on issue 19 by mattias.ellback: Support for <nil/> value
extension to the XML-RPC spec?
http://code.google.com/p/android-xmlrpc/issues/detail?id=19

hello I'm using this XML-RPC client for android for my thesis. I fixed so
it is possible to receive null.

added these lines in XMLRPCSerializer.java around line 127.

if (typeNodeName.equals(TYPE_NULL)){
parser.nextTag();
obj = null;
}

added TYPE_NULL = "nil" in IXMLRPCSerializer.java


hope that someone have some use for it.

Attachments:
XMLRPCSerializer.java 7.2 KB
IXMLRPCSerializer.java 895 bytes

android...@googlecode.com

unread,
Nov 19, 2010, 11:01:05 AM11/19/10
to android-x...@googlegroups.com
Updates:
Status: Accepted
Owner: j...@sprig.gs
Labels: Usability

Comment #2 on issue 19 by j...@sprig.gs: Support for <nil/> value extension

Thanks for this Mattias, I'll look at trying to patch that in at some point
over the next week or so.

android...@googlecode.com

unread,
Nov 22, 2010, 3:13:08 AM11/22/10
to android-x...@googlegroups.com

Comment #3 on issue 19 by Leiger40: Support for <nil/> value extension to

Perfect! Just went looking for this and it's good to see that it will be
implemented.

Thanks Mattias and Jon! :)

android...@googlecode.com

unread,
Nov 22, 2010, 3:01:15 PM11/22/10
to android-x...@googlegroups.com

Comment #4 on issue 19 by raffscallion: Support for <nil/> value extension

Great, thanks!

android...@googlecode.com

unread,
Nov 23, 2010, 2:42:27 PM11/23/10
to android-x...@googlegroups.com

Comment #5 on issue 19 by mattias.ellback: Support for <nil/> value

I added support for send null as well.
added these lines around line 29.
if (object == null){
serializer.startTag(null, TYPE_NULL).endTag(null, TYPE_NULL);
}
I hope that it works well.

Thanks for a great library.


Attachments:
XMLRPCSerializer.java 7.3 KB

android...@googlecode.com

unread,
Nov 23, 2010, 4:39:51 PM11/23/10
to android-x...@googlegroups.com
Updates:
Labels: -Type-Defect Type-Enhancement

Comment #6 on issue 19 by j...@sprig.gs: Support for <nil/> value extension

Hi mattias.ellback, thanks for these great fixes. I'm just adding them into
the code now, ready for pushing.

Would it be possible, in the future, to supply patches rather than complete
files? These can be created at the command line, by typing svn diff, or
your IDE may supply some route to create patches. It simply makes it easier
to see what the changes are you're introducing, although, to be fair, you
also document them in the comments, but it would save repeating them
twice :)

These patches are a real boon to anyone using this library. Top marks!

android...@googlecode.com

unread,
Nov 23, 2010, 6:54:42 PM11/23/10
to android-x...@googlegroups.com

Comment #7 on issue 19 by Leiger40: Support for <nil/> value extension to

Yes, the XML-RPC API I wish to connect to uses <nil/> so much that it's
*almost* useless to connect to it unless it is supported :) Thanks for
taking the time to add this into the official release Jon.

android...@googlecode.com

unread,
Nov 24, 2010, 4:48:55 AM11/24/10
to android-x...@googlegroups.com
Updates:
Status: Started

Comment #8 on issue 19 by j...@sprig.gs: Support for <nil/> value extension

It's in the repo now. Any chance someone can test it? (My XMLRPC service is
currently down, and I don't know when I'll have the chance to fix it any
time soon...)

Thanks!

android...@googlecode.com

unread,
Nov 24, 2010, 2:58:40 PM11/24/10
to android-x...@googlegroups.com

Comment #9 on issue 19 by j...@sprig.gs: Support for <nil/> value extension

I've just compiled the app and confirmed it compiles and runs properly at
least (with the test app and server in the repo), but, to confirm, I still
need to know whether this resolves the initially raised issue.

android...@googlecode.com

unread,
Nov 24, 2010, 11:12:16 PM11/24/10
to android-x...@googlegroups.com

Comment #10 on issue 19 by Leiger40: Support for <nil/> value extension to

Sorry, I won't be able to test it until this Saturday.

android...@googlecode.com

unread,
Aug 2, 2011, 12:01:42 AM8/2/11
to android-x...@googlegroups.com

Comment #11 on issue 19 by Leige...@gmail.com: Support for <nil/> value

Sorry about taking so long to get back to you, but I tested this about a
month ago and everything seemed to work correctly, so I believe </nil> is
now supported correctly.

Cheers,
Shane

android...@googlecode.com

unread,
Aug 2, 2011, 1:24:07 AM8/2/11
to android-x...@googlegroups.com
Updates:
Status: Done

Comment #12 on issue 19 by j...@sprig.gs: Support for <nil/> value extension

(No comment was entered for this change.)

android...@googlecode.com

unread,
Aug 2, 2011, 11:30:23 AM8/2/11
to android-x...@googlegroups.com

Comment #13 on issue 19 by raffscal...@gmail.com: Support for <nil/> value

Indeed. It does work now. Thanks.

android...@googlecode.com

unread,
Oct 3, 2011, 9:02:26 AM10/3/11
to android-x...@googlegroups.com

Comment #14 on issue 19 by sidzan...@gmail.com: Support for <nil/> value

Had similar problem with value ex:nil, resolved by adding

TYPE_NULL2 = "ex_nil"

to file

IXMLRPCSerializer.java

and modifying above code to

if (typeNodeName.equals(TYPE_NULL) || typeNodeName.equals(TYPE_NULL2) {

android...@googlecode.com

unread,
Oct 3, 2011, 9:06:27 AM10/3/11
to android-x...@googlegroups.com

Comment #15 on issue 19 by sidzan...@gmail.com: Support for <nil/> value

Had similar problem with value ex:nil, resolved by adding

TYPE_NULL2 = "ex:nil"

android...@googlecode.com

unread,
Oct 3, 2011, 9:10:29 AM10/3/11
to android-x...@googlegroups.com

Comment #16 on issue 19 by sidzan...@gmail.com: Support for <nil/> value

Had similar problem with value ex:nil, resolved by adding

String TYPE_NULL2 = "ex:nil";

to file

IXMLRPCSerializer.java

and modifying above code to

if (typeNodeName.equals(TYPE_NULL) || typeNodeName.equals(TYPE_NULL2)) {

android...@googlecode.com

unread,
Jan 13, 2013, 9:19:25 AM1/13/13
to android-x...@googlegroups.com

Comment #17 on issue 19 by r.frei...@gmx.at: Support for <nil/> value
Hi,

i had also a problem with support of two data types you use:

Apache says that "nil" and "i8" are extension data types:
http://ws.apache.org/xmlrpc/types.html
Those types are always used with namespace "ex", which refers to the
namespace URI "http://ws.apache.org/xmlrpc/namespaces/extensions". So I'm
wondering how this "nil" works for you, as the specification says that it
needs this "ex" prefix (same with "i8").

Therefore, I made two changes:

1) added "ex:" before the type constants in IXMLRPCSerializer:

String TYPE_I8 = "ex:i8";
String TYPE_NULL = "ex:nil";


2) added the namespace to the generated request XML in XMLRPCClient in
method "methodCall" after line "serializer.startDocument(null, null);":

serializer.setPrefix("ex", "http://ws.apache.org/xmlrpc/namespaces/extensions");


This works fine for me. Maybe there would be an easier solution for this as
you obviously have no problems in this area, but I wasn't able to figure
out anything else.

Thanks.
Reinhard Freiler


Reply all
Reply to author
Forward
0 new messages