我已经按照教程使用 mod_wsgi 设置 Apache 来连接cherrypy 并创建一个运行它的站点。这是我的“myapp.wsgi”,打开http://localhost/效果很好。打开http://localhost/ape/实际上返回文本而不是肥皂响应,并且http://localhost/ape/service.wsdl返回 500 HTTP 错误代码。在运行如此简单的 SOAP 服务时我做错了什么?我怎样才能让它返回有效的 WSDL?我的代码如下
干杯
尼克
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)