How to increase maximum size of the file in spyne?

209 Views Asked by At

I use spyne library for my soap service. There I have the line:

__in_protocol__ = Soap11(validator='lxml').

Problem is maximum size of lxml file. It's 10 mb. That means I can't transmit files more then 10 mb via spyne. How can I fix it ?

Addition.

The error has been called by this script:

# -*- coding: utf-8 -*-

import base64

from suds.client import Client
from suds.sax.element import Element

# My local server
LOCAL = 'http://localhost:5555/api/containerize?wsdl'

# ------------------ Creating new Client object ---------------------- #
client = Client(LOCAL)

# ------------------ Adding session key for soap header ------------------ #
el = Element('xsi:sessionkey').setText('87242d1869a344a4a64db2241771343b')
RequestHeader = Element('xsi:RequestHeader').insert(el)
client.set_options(soapheaders=RequestHeader)

container = client.factory.create('Container')
container.name = 'FNS_1AE4E68B842-86E9-4830-A1F3-2BC2FB0D2FE7_6324_06ce2326d5a840a7bb132c7e45711f61_10_04_07.zip'
container.content = base64.b64encode(open('test.txt', 'rb').read())
print len(container.content)

# -------------------- Sending soap message ----------------------- #
client.service.SendContainer(container)

The answer of this script is 500th error and I get that:

10094104
No handlers could be found for logger "suds.client"
Traceback (most recent call last):
  File "test.py", line 35, in <module>
    client.service.SendContainer(container)
  File "/home/samojlov/myprojects/iotchet/venv/local/lib/python2.7/site-packages/suds/client.py", line 542, in __call__
    return client.invoke(args, kwargs)
  File "/home/samojlov/myprojects/iotchet/venv/local/lib/python2.7/site-packages/suds/client.py", line 602, in invoke
    result = self.send(soapenv)
  File "/home/samojlov/myprojects/iotchet/venv/local/lib/python2.7/site-packages/suds/client.py", line 649, in send
    result = self.failed(binding, e)
  File "/home/samojlov/myprojects/iotchet/venv/local/lib/python2.7/site-packages/suds/client.py", line 702, in failed
    r, p = binding.get_fault(reply)
  File "/home/samojlov/myprojects/iotchet/venv/local/lib/python2.7/site-packages/suds/bindings/binding.py", line 265, in get_fault
    raise WebFault(p, faultroot)
suds.WebFault: Server raised fault: 'internal error: Huge input lookup, line 1, column 10094644'

But it works if I use file which is less then 9.7 mb.

Server side uses spyne library. I tried to find the root of the problem. I think it's lxml library which can't handle files more then 10 mb.

0

There are 0 best solutions below