3

I checked soaplib for python on net and i get the example

import soaplib
from soaplib.core.service import rpc, DefinitionBase
from soaplib.core.model.primitive import String, Integer
from soaplib.core.server import wsgi
from soaplib.core.model.clazz import Array


class HelloWorldService(DefinitionBase):
    @soap(String,Integer,_returns=Array(String))
    def say_hello(self,name,times):
        results = []
        for i in range(0,times):
            results.append('Hello, %s'%name)
        return results

if __name__=='__main__':
    try:
        from wsgiref.simple_server import make_server
        soap_application = soaplib.core.Application([HelloWorldService], 'tns')
        wsgi_application = wsgi.Application(soap_application)
        server = make_server('localhost', 7789, wsgi_application)
        server.serve_forever()
    except ImportError:
        print "Error: example server code requires Python >= 2.5"

this example is working fine. But i want to run this with the mod_wsgi in apache. I checked net and all come with django, cherrypy or pylone. Is it possible to run this example without any python web framwork? what are the steps to follow to run this example under mod_wsgi in apache. I want to run this in unix.

Dale Athanasias
  • 471
  • 3
  • 16
Nilesh
  • 20,521
  • 16
  • 92
  • 148

1 Answers1

3

Like every other "Integration With" document in the wiki, except with application = wsgi.Application(soap_application).

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • I checked in wiki but i didnt get idea what exact steps i have to do. Apache and modwsgi are new for me. If you can explain steps then it will be good. – Nilesh Jun 23 '11 at 10:30
  • 1
    At least *pretend* to read the articles before throwing your hands in the air and giving up... – Ignacio Vazquez-Abrams Jun 23 '11 at 10:31
  • Hello Ignacio i got the solution for this :) thx for your help. Now I am running http://soaplib.github.com/soaplib/2_0/pages/usermanager.html this example with serve_forever, and it works. But when i use mod_wsgi and I add and get some user it give wrong response most of the time. When i add user and i want to get back it give me no user error :(. Do you know why it's behaviour is different in mod_wsgi and server_forever ? – Nilesh Jul 20 '11 at 04:29