Note that there are some explanatory texts on larger screens.

plurals
  1. POTimeout while trying to use one service to call another deployed in the same domain
    primarykey
    data
    text
    <p>Based on this <a href="https://stackoverflow.com/questions/20275836/deploy-multiple-web-services-i-e-multiple-wsdl-files-in-python/20288864?noredirect=1#20288864">answer</a>, I was able to create and deploy 2 web services. However, if one service tried to call another, it hanged there until timeout.</p> <p>My code is:</p> <pre><code>from wsgiref.simple_server import make_server from spyne.application import Application from spyne.protocol.soap import Soap11 from spyne.util.wsgi_wrapper import WsgiMounter from suds.client import Client from spyne.decorator import srpc from spyne.service import ServiceBase from spyne.model.primitive import Unicode class Service_Caller(ServiceBase): @srpc(_returns=Unicode) def call_service(): client = Client("http://localhost:8000/hello?wsdl") result = client.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__': 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}) server = make_server('0.0.0.0', 8000, wsgi_app) server.serve_forever() </code></pre> <p>Service is called using:</p> <pre><code>from suds.client import Client client = Client('http://localhost:8000/caller?wsdl') client.service.call_service() </code></pre> <p>At the moment, the only way for my code to work is to deploy 2 services on different domain or on different port. I wonder if anyone has the same problem and knows any workaround. Thanks.</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. 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