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

  • Home
  • SEARCH
  • 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 76919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:44:56+00:00 2026-05-10T20:44:56+00:00

I am trying to export a Ruby framework via XML-RPC. However I am having

  • 0

I am trying to export a Ruby framework via XML-RPC. However I am having some problems when trying to call a method from a class not directly added as a handler to the XML-RPC server. Please see my example below:

I have a test Ruby XML-RPC server as follows:

require 'xmlrpc/server'  class ExampleBar   def bar()     return 'hello world!'   end end  class ExampleFoo   def foo()     return ExampleBar.new   end    def test()     return 'test!'   end end  s = XMLRPC::Server.new( 9090 )  s.add_introspection  s.add_handler( 'example', ExampleFoo.new )  s.serve 

And I have a test Python XML-RPC Client as follows:

import xmlrpclib  s = xmlrpclib.Server( 'http://127.0.0.1:9090/' )  print s.example.foo().bar() 

I would expect the python client to print ‘hello world!’ as it is the equivalent of the following ruby code:

example = ExampleFoo.new puts example.foo().bar() 

However it generates an error: ‘xmlrpclib.ProtocolError: <ProtocolError for 127.0.0.1:9090/: 500 Internal Server Error>’.

print s.example.test() works fine.

I dont expect the new ExampleBar object to go over the wire but I would expect it to be ‘cached’ server side and the subsequent call to bar() to be honoured.

Can XML-RPC support this kind of usage or is it too basic?

So I guess my question really is; how can I get this working, if not with XML-RPC what with?

  • 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. 2026-05-10T20:44:56+00:00Added an answer on May 10, 2026 at 8:44 pm

    Your client (s in you Python code) is a ServerProxy object. It only accepts return values of type boolean, integers, floats, arrays, structures, dates or binary data.

    However, without you doing the wiring, there is no way for it to return another ServerProxy, which you would need for accessing another class. You could probably implement an object cache on the Ruby side, but it would involve keeping track of active session and deciding when to remove objects, how to handle missing objects, etc.

    Instead I would suggest exposing a thin wrapper on the ruby side that does atomic operations like:

    def foobar()   return ExampleFoo.new().foo().bar() end 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 70k
  • Answers 70k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Unboxing is fast - no allocations are required. Boxing is… May 11, 2026 at 12:53 pm
  • added an answer Don't serialise local classes, because (a) the docs say so… May 11, 2026 at 12:53 pm
  • added an answer Easy with Boost.Filesystem: create_directories #include <boost/filesystem.hpp> //... boost::filesystem::create_directories('/tmp/a/b/c'); Returns: true… May 11, 2026 at 12:53 pm

Related Questions

I am trying to export some prepared assets out of Expression Design 2 and
I am trying to use the following code to export tables from access to
I am trying to do an automated xml export from an access database using
I am trying to set a javascript date so that it can be submitted
For a requirement i was asked to export information into a custom entity that
I'm trying to export a Crystal Report to a text file, while preserving any
I'm trying to export a Crystal Report to an HTML file, but when I

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.