I have a working web.py application, and a working Spyne application. I'd like to make web.py route requests to the spyne app when matching a certain url.
I tried with a wrapper as per web.py docs but no luck.
in myspyne.py:
import logging
logging.basicConfig(level=logging.DEBUG)
from spyne.application import Application
from spyne.decorator import srpc
from spyne.service import ServiceBase
from spyne.model.primitive import Integer
from spyne.model.primitive import Unicode
from spyne.model.complex import Iterable
from spyne.protocol.soap import Soap11
class HelloWorldService(ServiceBase):
@srpc(Unicode, Integer, _returns=Iterable(Unicode))
def say_hello(name, times):
for i in range(times):
yield 'Hello, %s' % name
application = Application([HelloWorldService],
tns='my.custom.ns',
in_protocol=Soap11(validator='lxml'),
out_protocol=Soap11())
in myweb.py:
urls = (
'/', 'index',
'/myspyne/(.*)', myspyne.application, # this does not work
)
class index:
def GET(self):
return "hello"
app = web.application(urls, globals(), autoreload=False)
application = app.wsgifunc()
if __name__ == '__main__':
app.run()