XL-RPC Recipe

T

Thomas

Hi list!

I'm struggling with a recipe from the Python Cookbook (2nd ed.)
concerning XML-RPC. It's recipe 15.2 "Serving XML-RPC Requests", and
since I thought it's a popular book some other folks might have
discovered (and probably solved) the same issue.

The recipe provides server and client code, and I get an
error when trying the following client request:

print server.python_string.join(['I', 'like it!'], " don't ")

(In the server code the string name space is mapped into the
'python_string' member with "import string; self.python_string = string").

The error report says:

xmlrpclib.Fault: <Fault 1: '<type \'exceptions.Exception\'>:method
"python_string.join" is not supported'>

This happens with all the string methods in
StringFunctions.python_string. Is there a general issue with mapping
name spaces into an RPC object? Or am I missing a major point here?

I tried all of this on a fairly up-to-date Linux with a stock
Python 2.5 (also tried with WinXP/cygwin/Python2.5.1 and with a
Stackless 2.5.1, always with same outcome, so I don't believe it's an
issue of a local installation).

Any hints?

=Thomas
 
T

Thomas

Ah, sorry, found the answer myself (not that I wasn't looking for it for
days...): I was aware that the recipe is online at ActiveState's site
(http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81549), but I
didn't read all of the comments carefully:

KAMOSAWA Masao wrote on 2006/04/29 that the use of dotted functions is
disabled by default in the server (from Python 2.4 onwards). But it can
be enabled with:

server.register_instance(StringFunctions(), allow_dotted_names = True)

=Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top