In XML-RPC Gateway, substitute __ for - in method names
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 22 Oct 2012 22:42:55 +0000 (18:42 -0400)
committerDan Scott <dan@coffeecode.net>
Thu, 21 Feb 2013 21:47:41 +0000 (16:47 -0500)
Dashes have never actually been valid in XML-RPC method names, and some
clients (like newer versions of Perl's RPC::XML) enforce this rule on
their clients.  This way we give XML-RPC clients a way they can still reach
our methods.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/XMLRPCGateway.pm

index 42b69f6..9e4a4c1 100644 (file)
@@ -85,6 +85,11 @@ sub handler {
 sub run_request {
     my( $service, $method, @args ) = @_;
 
+    $method =~ s/__/-/g;    # Our methods have dashes in them, but that's not
+                            # actually a valid character in XML-RPC method
+                            # names, and some clients enforce that restriction
+                            # on their users.
+
     # since multiple Perl clients run within mod_perl, 
     # we must set our ingress before each request.
     OpenSRF::AppSession->ingress('xmlrpc');