liaSoap.py
1.1 KB
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
from spyne.protocol.http import HttpRpc
from spyne.protocol.xml import XmlDocument
from spyne.server.wsgi import WsgiApplication
from processor.Orkis import Orkis
import logging
logging.basicConfig()
class getPhonService(ServiceBase):
@srpc(Unicode, _returns=Unicode)
def get_phon(string):
orkis=Orkis(string)
orkis.getDico()
return unicode(orkis)
application = Application([getPhonService],
tns='lia.tools.phon',
in_protocol=Soap11(),
out_protocol=Soap11()
)
wsgi_app = WsgiApplication(application)
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
server = make_server('192.168.75.140', 9000, wsgi_app)
server.serve_forever()