#1 XML-encoding of string params

open
nobody
None
5
2001-02-28
2001-02-28
Anonymous
No

Your rpcserver (and probably client, too) wrongly
presume that characters OTHER THAN "<" (less-than)
and "&" (ampersand) must be encoded. According to the
XML-RPC spec., only those 2 characters need-be
encoded, and this also works with all compliant XML
parsers as well. I suggest you simply remove code
that encodes characters such as ">" (greater-
than), "'" (quote), etc.

For instance, the following request/response work fine
where the requestor is a Perl script
(Frontier::Client) and the responder is your ASP
XMLRPC rpcserver (modified to en/decode only per the
XML-RPC):

The string argument is, itself, XML and looks like
this:

<?xml version="1.0"?>
<trade>
<trade_num>56</trade_num>
<trader_initials>APR</trader_initals>
</trade>

The properly encoded XML-RPC request (via
Frontier::Client in perl) is this:

<?xml version="1.0"?>
<methodCall>
<methodName>AllieHello.HelloWorld</methodName>
<params>
<param><value><string><?xml version="1.0"?>
<trade>
<trade_num>56</trade_num>
<trader_initials>APR</trader_initals>
</trade>
</string></value>
</param>
</params>
</methodCall>

Your ASP XMLRPC rpcserver (modified) returns this
response:

<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<string><?xml version="1.0"?>
<trade>
<trade_num>56</trade_num>
<trader_initials>APR</trader_initals>
<hello>World!</hello>
</trade></string>
</value>
</param>
</params>
</methodResponse>

This is as it should be, I think, rather than
en/decoding all of the ">" (greater-than)'s and other
characters as well.

Discussion