Home:ALL Converter>soaplib with mod_wsgi/cherrypy

soaplib with mod_wsgi/cherrypy

Ask Time:2009-03-25T01:28:40         Author:niklassaers

Json Formatter

I've followed the tutorials for setting up Apache with mod_wsgi to interface cherrypy and make a site running of it. This is my "myapp.wsgi", and opening http://localhost/ works great. Opening http://localhost/ape/ actually returns the text instead of a soap-response, and http://localhost/ape/service.wsdl returns a 500 HTTP error code. What am I doing wrong in getting such a simple SOAP service to run? How can I get it to return valid WSDL? My code follows below

Cheers

Nik

import atexit, threading, cherrypy,sys
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers.primitive import String, Integer, Array

sys.stdout = sys.stderr
cherrypy.config.update({'environment': 'embedded'})

class Root(object):
    def index(self):
        return 'Hello World!'
    index.exposed = True

    @soapmethod(_returns=String)
    def ape(self):
       return 'Ape!!'
    ape.exposed = True

application = cherrypy.Application(Root(), None)

Author:niklassaers,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/678409/soaplib-with-mod-wsgi-cherrypy
Eli Courtwright :

I just tested this myself by replacing the last line of your file with\n\ncherrypy.quickstart(Root(), \"/\")\n\n\nand it worked just fine for me. I suggest trying this and seeing whether it works for you; if it does then you'll know that it's an issue relating to running it under Apache/mod_wsgi and not an inherent problem with your code.",
2009-03-24T17:59:45
yy