[spyne] Array in Django SOAP webservice

carlos.palomares.external at airbus.com carlos.palomares.external at airbus.com
Thu Jun 18 10:27:39 UTC 2015

Hi everybody,

I have a problem with the type of Array in spyne, I am working with Django and my server is apache with wsgi.py in windows. I have these structures:

class IncidenceData(ComplexModel):
                __namespace__ = http://my/__IncidenceManagement/service.wsdl'
                __mixin__ = True
                _type_info = {
                               "Id": Integer,
                               "Categoria": Unicode,
                               "MSN": Unicode,
                               "FSolicitud": Unicode,
                               "Quien": Array(Unicode),
                               "Problema": Unicode,
                               "Solucion": Unicode,
                               "Responsables": Array(Unicode),
                               "FSolucion": Unicode,
                               "Status": Unicode,
                               "ValCierre": Unicode,

class ResponseDataQuery(ComplexModel):
                __namespace__ = http://my/__IncidenceManagement/service.wsdl'
                __mixin__ = True
                _type_info = {
                               "message": Unicode,
                               "codResultado": Integer,
                               "Incidences": Array(IncidenceData),
                               "IncidencesNotFound": Unicode,

And this method wich one I am using:

@srpc(Array(Integer), _returns=ResponseDataQuery)
                def GetInfoIncidences(elementos):
                               idNoEncontrados = ""
                               resData = ResponseDataQuery()
                                               for p in elementos:
                                                                              incidenciaRes = Soporte.objects.get(pk=p)
                                                                              retval = IncidenceData()
                                                                              retval.Id= incidenciaRes.pk
                                                                              retval.Categoria= incidenciaRes.categoria
                                                                              retval.MSN= incidenciaRes.MSN
                                                                              retval.FSolicitud= incidenciaRes.fechaSolicitudSoporte
                                                                              retval.Quien= incidenciaRes.gastadas
                                                                              retval.Problema= incidenciaRes.descripcion
                                                                              retval.Solucion= incidenciaRes.solucion
                                                                              retval.Responsables= incidenciaRes.gastadas
                                                                              retval.FSolucion= incidenciaRes.gastadas
                                                                              retval.Status= incidenciaRes.estadoSoporte
                                                                              retval.ValCierre= incidenciaRes.gastadas

                                                               except ObjectDoesNotExist:
                                                                              if idNoEncontrados == "":
                                                                                              idNoEncontrados = str(p)
                                                                                              idNoEncontrados = idNoEncontrados +";" + str(p)

                                               if idNoEncontrados!="":
                                                               resData.message = "ERROR"
                                                               resData.codResultado = 0
                                                               resData.IncidencesNotFound = idNoEncontrados
                                                               return resData

                                               resData.message = "CORRECT"
                                               resData.codResultado = 1
                                               return resData
                               except Exception as mine:
                                               print mine
                                               print '%s (%s)' % (mine.message, type(mine))
                                               resData.message = "Error en sistema DEMAT, Contacte con el administrador del sistema : " + '%s (%s)' % (mine.message, type(mine))
                                               resData.codResultado = 0
                                               return resData

This line is all time making error in my system:
'NoneType' object has no attribute 'append'
[Thu Jun 18 11:41:15 2015] [error] 'NoneType' object has no attribute 'append' (<type 'exceptions.AttributeError'>)

I don't what is the problem, the kind of data, the Array type maybe.............. I don't know anyone can help me?

Thanks in advance.

<html><head></head><body><font color="black" face="arial" size="2">
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spyne.io/archives/people/attachments/20150618/53e37738/attachment.html>

More information about the people mailing list