What steps will reproduce the problem? 1. See http://www.blueskyframework.org/framework/running-bluesky-through-web-services to see what I am trying to connect to. 2. Actual web service is http://blueskyweb.sonomatech.com/xml-rpc.py 3. Pass latitude and longitude, should return a structured result.
What is the expected output? What do you see instead? java.io.IOException: Cannot deserialize nil
What version of the product are you using? On what operating system? Android 2.0
Please provide any additional information below. I a a beginner and really don't know what I'm doing, so I'm really just interested in knowing if this is a limitation of android-xmlrpc or something I'm doing wrong. I am making the call like this:
XMLRPCClient client = new XMLRPCClient("http://blueskyweb.sonomatech.com/xml-rpc.py"); HashMap<String, Double> request = new HashMap<String, Double>(); request.put("Latitude", 45.46); request.put("longitude", -114.961); String result = "testing..."; try { result = (String) client.call("FCCS", request); } catch (XMLRPCException e) { // TODO Auto-generated catch block result = e.getMessage(); e.printStackTrace(); }
Comment #1
Posted on Nov 19, 2010 by Happy Elephanthello 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.
- XMLRPCSerializer.java 7.25KB
Comment #2
Posted on Nov 19, 2010 by Quick DogThanks for this Mattias, I'll look at trying to patch that in at some point over the next week or so.
Comment #3
Posted on Nov 22, 2010 by Helpful HippoPerfect! Just went looking for this and it's good to see that it will be implemented.
Thanks Mattias and Jon! :)
Comment #4
Posted on Nov 22, 2010 by Happy DogGreat, thanks!
Comment #5
Posted on Nov 23, 2010 by Happy ElephantI 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.
- XMLRPCSerializer.java 7.34KB
Comment #6
Posted on Nov 23, 2010 by Quick DogHi 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!
Comment #7
Posted on Nov 23, 2010 by Helpful HippoYes, the XML-RPC API I wish to connect to uses 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.
Comment #8
Posted on Nov 24, 2010 by Quick DogIt'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!
Comment #9
Posted on Nov 24, 2010 by Quick DogI'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.
Comment #10
Posted on Nov 25, 2010 by Helpful HippoSorry, I won't be able to test it until this Saturday.
Comment #11
Posted on Aug 2, 2011 by Helpful HippoSorry 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 is now supported correctly.
Cheers, Shane
Comment #12
Posted on Aug 2, 2011 by Quick Dog(No comment was entered for this change.)
Comment #13
Posted on Aug 2, 2011 by Happy DogIndeed. It does work now. Thanks.
Comment #14
Posted on Oct 3, 2011 by Happy HorseComment deleted
Comment #15
Posted on Oct 3, 2011 by Happy HorseComment deleted
Comment #16
Posted on Oct 3, 2011 by Happy HorseHad 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)) {
Comment #17
Posted on Jan 13, 2013 by Helpful RabbitHi,
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
Status: Done
Labels:
Type-Enhancement
Priority-Medium
Usability