Subject: | "<" not escaped in hash keys in methodResponse |
It looks like whatever encodes hash structures as XML doesn't escape "<"
characters if they appear in hash keys. Works fine for hash values with
"<" characters, though.
----- in httpd.conf -----
<Location /webwork2_rpc>
SetHandler perl-script
PerlHandler Apache::XMLRPC::Lite
PerlSetVar dispatch_to "WeBWorK::RPC"
</Location>
----- in WeBWorK/RPC.pm -----
package WeBWorK::RPC;
sub hi {
my %foo;
$foo{"the < message"} = "hello world";
$foo{"another_thing"} = "bar";
return \%foo;
}
----- in test.pl -----
my $rpc = XMLRPC::Lite->proxy("https://my.example.com:);
my $result = $rpc->call("WeBWorK.RPC.hi");
Show quoted text
----- the result -----
not well-formed (invalid token) at line 1, column 103, byte 103 at
/usr/local/lib/perl5/site_perl/5.8.8/mach/XML/Parser.pm line 187
<?xml version="1.0"
encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>the
< message</name><value><string>hello
world</string></value></member><member><name>another_thing</name><value><string>bar
<
foo</string></value></member></struct></value></param></params></methodResponse>
at sam_xmlrpc_test.pl line 14