2

I have a set of Python classes that I have generated for a SOAP service from a WSDL with ZSI. I have another Python module that calls the SOAP service using these generated classes. Unfortunately, the code keeps throwing an EvaluateException with the following error message when run:

maxOccurs unbounded, expecting a [<type 'tuple'>, <type 'list'>]

Unfortunately, I'm neither a SOAP expert nor a ZSI expert, and I can't even figure out what this error means. Does anyone know what problem it is trying to describe, and how I might go about solving (or at least debugging) it? The message doesn't make much sense to me.


The exact error message in the EvaluateException is

pyobj (http://Think/XmlWebServices/,customer_data), aname "_customer_address_data": maxOccurs unbounded, expecting a [<type 'tuple'>, <type 'list'>] [Element trace: /SOAP-ENV:Body/ns1:customer_add_request]

if that helps, although that error message contains some strings that are specific to the generated classes that I am debugging.

mipadi
  • 398,885
  • 90
  • 523
  • 479
  • [Those ZSI errors are a pain to understand](http://stackoverflow.com/questions/14059142/create-python-soap-server-based-on-wsdl/14081698#14081698). +1 and good luck. – Bogdan Aug 07 '13 at 09:36
  • Simple `grep` on ZSI code base shows than exception is raized here http://pywebsvcs.svn.sourceforge.net/viewvc/pywebsvcs/trunk/zsi/ZSI/TCcompound.py?revision=1502&view=markup on line 373. It looks like you are trying to send wrong parameters to SOAP service. – twil Aug 08 '13 at 22:56

1 Answers1

0

You are certainly using the generated classes/types in a wrong way. As the message indicates "_customer_address_data" requires a sequence, it is unbounded after all. Since you have not shown your WSDL file or generated calss, I guess you are passing a value with wrong data type. I suggest you change the TCcompound.py file in ZSI to print out your data as, it would be something like this(find the "def cb" in your version of ZSI):

        whatTC = what
        if whatTC.maxOccurs > 1 and v is not None:
            if type(v) not in _seqtypes:
                raise EvaluateException('pyobj (%s,%s), aname "%s": maxOccurs %s, expecting a %s got %s instead' %(
                     self.nspname,self.pname,what.aname,whatTC.maxOccurs,_seqtypes, type(v)),
                     sw.Backtrace(elt))

run it again and see what's going on.

thek33per
  • 132
  • 4