Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's because of the WSGI implementation that you're using(<code>wsgiref</code>). <code>wsgiref</code> is just a reference Wsgi implementation and does not support concurrency. For production use, you should switch to a proper wsgi container like mod_wsgi, CherryPy, twisted, etc and <em>never</em> use <code>wsgiref</code>.</p> <p>Again, and I can't stress this enough, <em>never</em> use <code>wsgiref</code> for production use.</p> <p>That being said, if you just want to call one service from another one, there's a better way:</p> <pre><code>from spyne.util.appreg import get_application app = get_application('example2', 'Application').null print app.service.say_hello('world') </code></pre> <p>Here's the fully working example:</p> <pre><code>from spyne.application import Application from spyne.protocol.soap import Soap11 from spyne.util.wsgi_wrapper import WsgiMounter from spyne.decorator import srpc from spyne.service import ServiceBase from spyne.model.primitive import Unicode from spyne.util.appreg import get_application class Service_Caller(ServiceBase): @srpc(_returns=Unicode) def call_service(): # 'Application' is the default when you omit the `name` argument to the # `Application` initializer. app1 = get_application('example2', 'Application').null result = '\n'.join(app1.service.say_hello('world')) return result class HelloWorldService(ServiceBase): @srpc(Unicode, _returns=Unicode) def say_hello(name): return [u'Hello, %s' % name] if __name__ == '__main__': import logging logging.basicConfig(level=logging.DEBUG) app1 = Application([Service_Caller], 'example1', in_protocol=Soap11(), out_protocol=Soap11()) app2 = Application([HelloWorldService], 'example2', in_protocol=Soap11(), out_protocol=Soap11()) wsgi_app = WsgiMounter({"caller":app1, "hello":app2}) from wsgiref.simple_server import make_server server = make_server('0.0.0.0', 8000, wsgi_app) server.serve_forever() </code></pre> <p>I hope that helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload