views:

766

answers:

3

Hi guys, 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)
+1  A: 

I just tested this myself by replacing the last line of your file with

cherrypy.quickstart(Root(), "/")

and 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.

Eli Courtwright
Hi Eli, thank you very much for your time. Were you able to retrieve /ape/service.wsdl?
niklassaers
+1  A: 

Eli is right; it's not enough to just make an Application instance. You have to mount it on cherrypy.tree, which quickstart() does for you.

fumanchu
A: 

Sorry for resurrecting such an old problem, but it's the same for me.

everything works the same way as Nik's

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

but when i change it to cherrypy.quickstart,it stops working (even Hello World). it hangs with "waiting for localhost..." message. Could u guys help me?