Hi again,
I checked the problem more thoroughly and I found that
IsAssignableFrom also matches 'interfaces'. This can miss identify
other data types. Therefore my solution wasn't correct.
This one I guess is the correct one:
if (t == typeof(XmlRpcStruct) || t.IsSubclassOf(typeof(XmlRpcStruct)))
I tested it with some XmlRpcStruct child classes and it seems to work.
Best regards,
Javier Gonel.
--- In XMLRPCNET@yahoogroups.com, "Javier Gonel" <bolibic@...> wrote:
>
> Hi all,
>
> I discovered that I cannot extend XmlRpcType. It's not a problem with
> the XmlRpcType class itself, but with the XmlRpcService class that
> identifies the Xml-RPC type.
>
> In the CookComputing.XmlRpc.XmlRpcServiceInfo class, method
> GetXmlRpcType, I've found this comparison (line 275):
>
> else if (t == typeof(XmlRpcStruct)))
> {
> ret = XmlRpcType.tHashtable;
> }
>
> This doesn't allow to extend XmlRpcType because when you send your
> extended object the type won't match.
>
> I patched the line with this check:
>
> else if (t.IsAssignableFrom(typeof(XmlRpcStruct)))
>
> This allows XmlRpcStruct and derived types to be identified as they
> should.
>
> Perhaps there is a reason for that check to be in that way, but
> without more info I guess this behavior should be patched.
>
> Regards,
> Javier Gonel
>