Null is a non standard extension to XML-RPC. Hannes used to support it but
removed it when Dave Winer (who owns the spec) voiced his disapproval of the
extension.
I think that the code may have a problem with this situation. I spent some
time working with Rick Blair on a similar point.
I think that the server returns something like
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultString</name>
<value><string>java.lang.RuntimeException: null value not
supported by XML-RPC</string></value>
</member>
<member>
<name>faultCode</name>
<value><int>0</int></value>
</member>
</struct>
</value>
</fault>
</methodResponse>
Which is obviously wrong. Rick was going to report it as a bug but he has
yet to do so, so I will;)
I was going to test this and offer a patch but I'm afraid I a bit pressed
for time at the moment.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk
----- Original Message -----
From: "Martin Skopp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 19, 2002 12:50 PM
Subject: Return value 'null' not supported
> Hi,
>
> I have a server method usually returning a native result of class
> String. Works perfect.
> Until it returns "null"... For returning "null", I get the following
error:
>
> Fatal error parsing XML: org.xml.sax.SAXParseException: unexpected end
> of file found
>
> After switching the server into debug mode, I get:
>
> Searching for method: getService
> Parameter 0: class java.lang.String = lalala
> outparam = null
> java.lang.RuntimeException: null value not supported by XML-RPC
> at org.apache.xmlrpc.XmlRpc.writeObject(XmlRpc.java)
> at
> org.apache.xmlrpc.XmlRpcServer$Worker.writeResponse(XmlRpcServer.java
> )
>
> I can work around that of course... To improve org.apache.xmlrpc, think
> about the following:
>
> Is "null" not supported by the XML-RPC specs?
>
> Is there hope that "null" will be supported by org.apache.xmlrpc in the
future?
>
> If "null" is allowed by the specs, can someone put this on a TODO
> list/implement it?
>
> If "null" is NOT allowed by the specs, maybe a developer can change the
> error message a bit? Instead "Fatal error parsing XML", I would prefer
> "Invalid method return value 'null' by [NAME_OF_CLASS_AND_METHOD] - not
> allowed by XMLRPC specs" or similar...
>
> Thanks,
>
>
> Martin Skopp
> --
> Riege Software International GmbH
> http://www.riege.com info: mailto:[EMAIL PROTECTED]
> Support: mailto:[EMAIL PROTECTED]
>
>