I have Flask-Spyne server (web service) and I want to return (return to client after he will ask) a XML file.
I want to do this:
- I will put some things from database to XML. (solved)
- I have that XML saved on server (webservice) and I want to send it to client when he ask. (this is a problem)
Is there a way how to do it?
Here is mine code:
class Service(spyne.Service):
__service_url_path__ = '/soap';
__in_protocol__ = Soap11(validator='lxml');
__out_protocol__ = Soap11();
@spyne.srpc(DateTime, DateTime, _returns="What to put here?")
def Function(A,B):
GetXML(A,B)
s = open("file.xml");
return s;
if __name__ == '__main__':
app.run(host = '127.0.0.1');
Thank You very much for any help.. :)
EDIT:
So, this is mine code now: (sending string)
@spyne.srpc(DateTime, DateTime, _returns=Iterable(Unicode))
def oracle(A,B):
GetXML(A,B)
s = open("file.xml");
return s