magosoft / xmlrpcnet

Automatically exported from code.google.com/p/xmlrpcnet
0 stars 0 forks source link

Support for No Params Element if Zero Parameters #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Email from Leif Opseth:

I've recently written some code using the excellent XML-RPC.NET library.
However, I ran into an XML-RPC server that required a small change to the
XML-RPC.NET source code to work, and I'm wondering if this issue could be
something that the 'official' XML-RPC.NET source also should address.

The issue is as follows:

The original xml-rpc.net code sends parameter data for functions that has
no parameters as an empty 'params' tag, i.e. as:
--
<methodCall>
       <methodName>some_function</methodName>
       <params />
</methodCall>
--

The XML-RPC server in question does not handle this empty tag, and require
these no-parameter functions to be encoded without the empty tag, e.g. as:
--
<methodCall>
       <methodName>some_function</methodName>
</methodCall>
--

My fix to the XML-RPC.NET source was to simply check for non-zero number
of params before applying the 'params' tag in the 'SerializeRequest'
function in 'XmlRpcSerializer.cs'.

After reading the XML-RPC specification, I can't find that the empty
'params' tag is a requirement, so in theory the XML-RPC server does
nothing wrong (although it could of course be more versatile).

I would think that there could be other servers out there that could have
a similar implementation, and I think that simply adding something like a
'UseEmptyParamsTag' property to e.g. the XML-RPC.NET's 'IXmlRpcProxy'
interface, would make the XML-RPC.NET library more robust for different
implementations. A default value for this property set to 'true' will make
the library code compatible with code that currently uses XML-RPC.NET.
Setting this property to 'false' will solve my current server issue.

Original issue reported on code.google.com by ChasC...@gmail.com on 27 Mar 2008 at 10:15

GoogleCodeExporter commented 9 years ago
Fixed in revision 36.

Original comment by ChasC...@gmail.com on 2 Apr 2008 at 8:01

GoogleCodeExporter commented 9 years ago

Original comment by ChasC...@gmail.com on 4 Apr 2008 at 6:50