I'm creating web services in python using Spyne based on this example. However, all my services are combined into one wsdl file locating at http://localhost:8000/?wsdl
. I'm looking for another way to deploy each web service separately in a single wsdl file, e.g.
http://localhost:8000/service1/?wsdl
and http://localhost:8000/service2?wsdl
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Spyne has a
WsgiMounter
class for this:Now you can pass
wsgi_app
to the Wsgi implementation that you're using the same way you'd pass aWsgiApplication
instance.Your Wsgi implementation also would definitely have a similar functionality, you can also use that in case e.g. you need to serve something for the root request instead of an empty 404 request.
An up-to-date fully working example can be found at: https://github.com/plq/spyne/blob/master/examples/multiple_protocols/server.py
Please note that you can't use one
Service
class with multiple applications. If you must do that, you can do it like this:and use the
SomeServiceFactory()
call for everyApplication
instance.e.g.
Hope that helps.