Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8032513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:24:37+00:00 2026-06-05T01:24:37+00:00

This answer implies I can use getattr on an xmlrpc server proxy. However, in

  • 0

This answer implies I can use getattr on an xmlrpc server proxy. However, in my case that doesn’t seem to work. Am I missing a step in the definition of my server?

My server code is this:

import SimpleXMLRPCServer
class Listener(object):
    def ping(self):
        return "ping"
s = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost",8910), allow_none=True)
l = Listener()
s.register_instance(l)
s.register_introspection_functions()
s.serve_forever()

When I use it interactively I can call the ping function, but I can’t use getattr on the proxy:

$ python -i
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> proxy = xmlrpclib.ServerProxy("http://localhost:8910", allow_none=True)
>>> proxy.ping()
'ping'
>>> getattr(proxy, "ping")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "c:\Python27\lib\xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "c:\Python27\lib\xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "c:\Python27\lib\xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "c:\Python27\lib\xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "c:\Python27\lib\xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: '<type \'exceptions.Exception\'>:method "ping.__repr__" is not supported'>
>>> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:24:38+00:00Added an answer on June 5, 2026 at 1:24 am

    It does not work this way in the interactive console. The console wants to show the repr of the function but trying to call ping.__repr__ fails.

    Assigning to a variable works:

    >>> f = getattr(proxy, 'ping')
    >>> f()
    'ping'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in this answer he said that i can use RIA services while creating my
Given this answer: https://stackoverflow.com/a/4263048 Which is excellent, how can we be sure that out
From this Answer , I came to know that KeyValuePair are immutables. I browsed
I'm tinkering with an iPad app that (like many iPad apps) doesn't use the
The MySQL documentation implies that you can assign one or more of a table's
In this question the answer was to flip on a switch that is picked
This answer says that the XmlHttpRequestObject Level 2 supports cross-site ajax calls. I know
as I think I can answer this question to myself by reading the MSDN
This answer explains how to create test cases dynamically. The answer's code: class Tests(unittest.TestCase):
This answer says: Vim's undo/redo system is unbeatable. Type something, undo, type something else,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.