首页  >  问答  >  正文

python - spyne编写soap协议的webservice,怎么样才能让接口支持多线程处理

我使用spyne库,编写了一个简单的soap协议是的webservice,但我的客户端使用了多线程,那服务端怎样才能支持多线程处理?请详细说明。
from spyne import Application, rpc, ServiceBase
from spyne import Integer, Unicode, Array, ComplexModel
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from wsgiref.simple_server import make_server

class SomeSampleServices(ServiceBase):

@rpc(Unicode, Unicode _returns=Unicode)  
def make_project(self, name, version):  
    print name
    print version  

if name == "__main__":

soap_app = Application([SomeSampleServices],  
                       'SampleServices',  
                       in_protocol=Soap11(validator="lxml"),  
                       out_protocol=Soap11())  
wsgi_app = WsgiApplication(soap_app)  
server = make_server(ip, port, wsgi_app)  

sys.exit(server.serve_forever())  
巴扎黑巴扎黑2741 天前1094

全部回复(0)我来回复

暂无回复
  • 取消回复