Blame view
liaSoap.py
1.15 KB
dcdaad1b0
|
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
|
8 9 |
from spyne.protocol.http import HttpRpc from spyne.protocol.xml import XmlDocument |
dcdaad1b0
|
10 11 |
from spyne.server.wsgi import WsgiApplication from processor.Orkis import Orkis |
b65eb4cd1
|
12 13 |
import logging logging.basicConfig() |
9ffd72ac1
|
14 |
class getPhonService(ServiceBase): |
dcdaad1b0
|
15 |
@srpc(Unicode, _returns=Unicode) |
9ffd72ac1
|
16 17 |
def get_phon(string): orkis=Orkis(string) |
dcdaad1b0
|
18 |
orkis.getDico() |
44c17c423
|
19 |
#print(unicode(orkis)) |
b65eb4cd1
|
20 |
return unicode(orkis) |
dcdaad1b0
|
21 |
|
9ffd72ac1
|
22 23 |
application = Application([getPhonService], tns='lia.tools.phon', |
44c17c423
|
24 25 |
in_protocol=Soap11(encoding='UTF-8'), out_protocol=Soap11(encoding='UTF-8') |
dcdaad1b0
|
26 |
) |
9ffd72ac1
|
27 |
wsgi_app = WsgiApplication(application) |
dcdaad1b0
|
28 29 30 31 32 |
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 |
127210d9e
|
33 |
server = make_server('127.0.0.1', 9000, wsgi_app) |
dcdaad1b0
|
34 |
server.serve_forever() |