Closed GoogleCodeExporter closed 9 years ago
Hello,
We had the same problem communicating with Magento (written in PHP -
http://www.magentocommerce.com/).
<value><nil/></value> seem to be a common practice...
As said above, the thing is that in the method ParseValue method (file
XmlRpcSerializer:869) there is no "else if(node.Name == "nil")" and in this
case, the
method returns null. Which is fine in our case.
But later, the code wants to get the type of the value and so throws a
NullReferenceException.
We resolved the problem by adding a test before getting value:
File XmlRpcStruct.cs:39, replace
if (XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
by
if (value != null && XmlRpcServiceInfo.GetXmlRpcType(value.GetType())
Even if the "<nil/>" is not standard and not supposed to be supported, to my
sense,
the fact that there is no final "else" case and then later throw a
NullReferenceException when the situation is reached is a bug.
The lib should explicitely exclude the unsupported cases by adding something
like
else{ throw new NotSupportedException("some message"); }
or at least make an Assert.
Original comment by alainca...@gmail.com
on 16 Dec 2008 at 2:48
Original comment by ChasC...@gmail.com
on 19 Dec 2008 at 1:58
I also need this to be completed. The Wikidot.com API uses <nil/> for some of
it's responses.
I will try modifying my copy of the library based on the suggestions above, but
I'd certainly appreciate it being part of the official release.
Thanks,
Shane
Original comment by Leige...@gmail.com
on 16 Oct 2010 at 8:53
<nil/> values supported in release 3.0
Original comment by ChasC...@gmail.com
on 6 Mar 2011 at 10:08
Thanks!
Original comment by Leige...@gmail.com
on 6 Mar 2011 at 10:27
Original issue reported on code.google.com by
4maxim@gmail.com
on 19 Sep 2008 at 1:02