Paul Prescod wrote:
> Is this doc out of date or do I misunderstand it:
> "A choice is a Python two-element "(name, value)" tuple."
Okay, just a misunderstanding. Let me see if I can help to rephrase the
docs so that I would have understood them.
A choice represents a union of two different types. For instance if any
of a string, an integer or a decimal are allowed in an SOAP message then
the Choice typecode allows you to say so.
class Choice(typecode_seq, name[, **keywords])
When serializing Python objects to SOAP messages, the programmer must
declare which type of data is being provided. Instead of passing just a
Python object, it should pass a tuple. The first item in the tuple is a
string identifying the name of a typecode from typecode_seq. The second
is the object to be serialized.
When parsing, ZSI will look at the element name in the SOAP message, and
determine which of the choices to create.