Problem with nil value in JAVA

Problem with nil value in JAVA

by Alberto del Pozo -
Number of replies: 0
Hi!

For the last days we've had some problems with the library used to connect via xml-rpc from a java client with Moodle 2.0. The library returns an error like this:

org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse server's response: Unknown type: nil

We are using a library downloaded from the xmlrpc web site (http://www.xmlrpc.com) (but we found that this problem happened in more libraries) and I would like to share the solution in case it can be solved from the server side. We found it here but it works fine for other libraries, it's only necessary to add some code in the library or extend a class of it and it will work fine. The problem is that JAVA doesn't recognise nil value and throws an exception. This piece of code parses this nil value in order to avoid the problem.

I hope it helps somebody.

Cheers.
Pozo.
Average of ratings: -