Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > XL-RPC Recipe

Thread Tools

XL-RPC Recipe

Posts: n/a
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?

Reply With Quote
Posts: n/a
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
(, 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)

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: recipe Fulag the pimp-discourser Computer Support 1 02-07-2005 07:21 PM
What's your favorite thai recipe? Ron Hunter Digital Photography 7 06-23-2004 10:24 AM's the recipe for banana bread... 925/ 207-9350 ZBOXMAN ROGER THE BOX MAN FREE PC RECYCLING MOVING BOXES GET STARBUCKS CARDS FROM ME Cisco 0 02-02-2004 08:19 PM
recipe site?? --==::::==-- Computer Support 9 01-10-2004 09:29 AM
secret recipe needed Roslynn Hook Computer Support 1 12-12-2003 05:38 AM