2

I am writing an xmlrpc client which uses a server written in ruby. One of the functions is framework.busy?(). Let me show the ruby version:

server.call( "framework.busy?" )  

So lets assume I create an instance of the ServerProxy class say server. So while using python to call the function busy? I need to use:

server.framework.busy?()  

This leads to an error:

SyntaxError: invalid syntax  

How can I call this function? Or am I reading the ruby code wrong and implementing it wrongly.

Veger
  • 37,240
  • 11
  • 105
  • 116
satran
  • 1,222
  • 4
  • 16
  • 27

1 Answers1

6

I've never had to call XML methods with a question mark in (and I strongly suspect it might actually be outside XML-RPC specs), but try this:

server.framework.getattr('busy?')()

I have no idea of that works, and you would need to post a code example and have a working server I could test against. :)

In any case it's probably not a good idea to have a question mark in the method name, so if you can modify the Ruby server to something more sane, that would be helpful.

Lennart Regebro
  • 167,292
  • 41
  • 224
  • 251
  • 3
    You are correct that 'busy?' is not a valid xml-rpc method name. The specification (at http://www.xmlrpc.com/spec ) says: "The must contain a sub-item, a string, containing the name of the method to be called. The string may only contain identifier characters, upper and lower-case A-Z, the numeric characters, 0-9, underscore, dot, colon and slash. It's entirely up to the server to decide how to interpret the characters in a methodName." – Duncan Jan 04 '11 at 13:07
  • 1
    Which means this answer should still be usefull to call methods that would have dot, colon and slash in their names. – jsbueno Jan 04 '11 at 13:46
  • 1
    Yes i spoke to the programmer and he has changed the method names in the server. Thanks for the replies. – satran Jan 04 '11 at 14:23