title: How to invoke an XML RPC method with Python when the method name is only known at runtime?
body: <p>I've got some Python code below that invokes an XML RPC method:</p>
  
  <pre class="lang-python prettyprint-override"><code>from xmlrpclib import ServerProxy
  
  s = ServerProxy("http://localhost:8000")
  s.SomeMethod('parameter')
  </code></pre>
  
  <p>However, what happens when the name of the method (<code>SomeMethod</code>) is only known at runtime? Is there any way to invoke a method when the name of the method is in a variable?</p>
  
  <p>I've tried the following and none of them work:</p>
  
  <pre class="lang-python prettyprint-override"><code>s['SomeMethod']('parameter')
  s.__getattr__('SomeMethod')('parameter')
  getattr(s, 'SomeMethod')('parameter')
  </code></pre>
  
  <p>All of them return:</p>
  
  <pre><code>xmlrpclib.Fault: &lt;Fault -32601: 'Method not found'&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Further edit:</strong> this is starting to get really strange. When I use <code>s['SomeMethod']('parameter')</code>, the remote server reports that I tried to invoke the XML method <code>__getattr__</code>.</p>