I have a created a very simple SOAP wsgi webserver in Python using spyne, which only has a returnint() service:
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from wsgiref.simple_server import make_server
class TestService(ServiceBase):
@rpc( _returns=Integer)
def returnint(self):
return 1
application = Application([TestService], 'return.int.soap',
in_protocol=Soap11(validator='lxml'),
out_protocol=Soap11())
if __name__ == '__main__':
server = make_server('127.0.0.1', 8000, wsgi_application)
server.serve_forever()
I am testing the service using suds like so:
from suds.client import Client
client = Client("http://localhost:8000/?wsdl")
while True:
result = client.service.returnint()
print(result)
This seems to be working fine (the service returns 1 when it is called), however, the problem I am facing is that the client seems to receive a response every 2 seconds. Does anyone know what is the reason behind this delay and if there is any way to remove it? If this is not possible, I would really appreciate any comments regarding suitable alternatives.