I am trying to return XLS file throught webservice created with spyne.
Here is mine code, now, I don't know what to do..
@spyne.srpc(Unicode, _returns=Iterable(Unicode))
def Function(A):
GetXLS(A)
kalist = open("file.xls", 'r');
return kalist
The most important lines are last 2. :)
I am thinking about this: Is it possible to return xls file with spyne or should I do something with that xls and then return that?
Thank you for all your answers
PS: That xls is from BLOB file (from Oracle DB), so, if needed, I have BLOB too..
Edit:
This is that AssertionError that appeared:
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [14/Jul/2016 07:15:19] "GET /soap/oracleservice?wsdl HTTP/1.1" 200 -
ERROR:spyne.util:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\spyne\util\__init__.py", line 120, in start
next(ret)
File "C:\Python27\lib\site-packages\spyne\protocol\xml.py", line 782, in _get_members_etree
sub_name)
File "C:\Python27\lib\site-packages\spyne\protocol\xml.py", line 463, in to_parent
return handler(ctx, cls, inst, parent, ns, *args, **kwargs)
File "C:\Python27\lib\site-packages\spyne\protocol\xml.py", line 616, in modelbase_to_parent
elt.text = self.to_unicode(cls, inst)
File "C:\Python27\lib\site-packages\spyne\protocol\_outbase.py", line 211, in to_unicode
return handler(class_, value, *args, **kwargs)
File "C:\Python27\lib\site-packages\spyne\protocol\_outbase.py", line 441, in file_to_unicode
return self.file_to_string(cls, value, suggested_encoding)
File "C:\Python27\lib\site-packages\spyne\protocol\_outbase.py", line 421, in file_to_string
assert False
AssertionError
127.0.0.1 - - [14/Jul/2016 07:15:21] "POST /soap/oracleservice HTTP/1.1" 200 -
INFO:werkzeug:127.0.0.1 - - [14/Jul/2016 07:15:21] "POST /soap/oracleservice HTTP/1.1" 200 -