title: Programmatically invoke RPC methods for a SOAP endpoint in python
body: <p>I'm looking for a simple way to programmatically invoke a SOAP/RPC call via Python. Something like:</p>
  
  <pre><code>method_to_invoke, args = parse_user_input()
  outbound_xml = library.call_remote_method(method_to_invoke, args)
  result = requests.post(... data=outbound_xml)
  </code></pre>
  
  <p>I know there are <a href="https://wiki.python.org/moin/WebServices" rel="noreferrer">several</a> Python libraries that support SOAP/RPC calls; however they all do some "magic" and allow for things like:</p>
  
  <pre><code>result = client.service.getPercentBodyFat('jeff', 68, 170)
  </code></pre>
  
  <p>(previous example taken from <a href="https://fedorahosted.org/suds/wiki/Documentation" rel="noreferrer">suds documentation</a> but the basic principles are the same). This assumes I know the name of the method ahead of time and can't determine it at runtime.</p>
  
  <p>Looking for solutions they are either no longer maintained, or try to do too much "magic". For example see <a href="https://stackoverflow.com/a/1858144/204634">this over-complicated soution</a> or <a href="https://stackoverflow.com/a/26506633/204634">this solution</a> which is basically "Build your own XML and send it over".</p>
  
  <p>Is there any library that can build the "outbound" XML for me without having to go through hoops? I already have a HTTP server which would receive the inbound RPC and want to use <code>requests</code> to properly handle things like SSL certificate validation. </p>