title: How do you setup a pysimplesoap server to run on apache2 with wsgi?
body: <p>I have a soap server which I have been running as a stand-alone application i.e. by just simply executing <code>python mysoapserver.py</code></p>
  
  <p>However, I would like it to be accessed via apache2 using wsgi.</p>
  
  <p>Below are some code excerpts of the current code:</p>
  
  <p><strong>The imports:</strong></p>
  
  <pre><code>from pysimplesoap.server import SoapDispatcher, SOAPHandler, WSGISOAPHandler
  </code></pre>
  
  <p><strong>Code Excerpts</strong></p>
  
  <pre><code>dispatcher = SoapDispatcher(
  'TransServer',
  location = "http://127.0.0.1:8050/",
  action = 'http://127.0.0.1:8050/', # SOAPAction
  namespace = "http://example.com/sample.wsdl", prefix="ns0",
  trace = True,
  ns = True)
  
  #Function
  def settransactiondetails(sessionId,msisdn,amount,language):
      #Some Code here
      #And more code here
      return {'sessionId':sid,'responseCode':0}
  
  # register the user function
  dispatcher.register_function('InitiateTransfer', settransactiondetails,
      returns={'sessionId': str,'responseCode':int}, 
      args={'sessionId': str,'msisdn': str,'amount': str,'language': str})
  
  logging.info("Starting server...")
  httpd = HTTPServer(("", 8050),SOAPHandler)
  httpd.dispatcher = dispatcher
  httpd.serve_forever()
  </code></pre>
  
  <p>How would I need to change the code above so as to make it accessible on apache2 via wsgi.
  You can also include the changes that I would need to make on the <code>/etc/apache2/sites-available/default</code> file.</p>