Blame view
liaSoap.py
1.1 KB
dcdaad1b0 passage en soap :... |
1 2 3 4 5 6 7 |
from spyne.application import Application from spyne.decorator import srpc from spyne.service import ServiceBase from spyne.model.primitive import Integer from spyne.model.primitive import Unicode from spyne.model.complex import Iterable from spyne.protocol.soap import Soap11 |
b65eb4cd1 ajout des port Or... |
8 9 |
from spyne.protocol.http import HttpRpc from spyne.protocol.xml import XmlDocument |
dcdaad1b0 passage en soap :... |
10 11 |
from spyne.server.wsgi import WsgiApplication from processor.Orkis import Orkis |
b65eb4cd1 ajout des port Or... |
12 13 |
import logging logging.basicConfig() |
9ffd72ac1 ajout du test |
14 |
class getPhonService(ServiceBase): |
dcdaad1b0 passage en soap :... |
15 |
@srpc(Unicode, _returns=Unicode) |
9ffd72ac1 ajout du test |
16 17 |
def get_phon(string): orkis=Orkis(string) |
dcdaad1b0 passage en soap :... |
18 |
orkis.getDico() |
b65eb4cd1 ajout des port Or... |
19 |
return unicode(orkis) |
dcdaad1b0 passage en soap :... |
20 |
|
9ffd72ac1 ajout du test |
21 22 |
application = Application([getPhonService], tns='lia.tools.phon', |
dcdaad1b0 passage en soap :... |
23 24 25 |
in_protocol=Soap11(), out_protocol=Soap11() ) |
9ffd72ac1 ajout du test |
26 |
wsgi_app = WsgiApplication(application) |
dcdaad1b0 passage en soap :... |
27 28 29 30 31 |
if __name__ == '__main__': # You can use any Wsgi server. Here, we chose # Python's built-in wsgi server but you're not # supposed to use it in production. from wsgiref.simple_server import make_server |
b65eb4cd1 ajout des port Or... |
32 |
server = make_server('192.168.75.140', 9000, wsgi_app) |
dcdaad1b0 passage en soap :... |
33 |
server.serve_forever() |