#34 Easy complex returns for with wsdl2py/dispatch

Unstable (example)
open
nobody
zsi (12)
5
2006-01-19
2006-01-19
Thomas Jacob
No

When using zsi's wsdl2py/dispatch generated
code to return complex types/arrays, you usually have
to use typecode directly, i.e. you cannot
simply return a combination of python lists
and dictionaries. But the zsi-serializer
has all the info in place to make this possible
it looks like, as it already knows the target
typecode from the wsdl2dispatch generated stuff.

This small patch (against 2.0/CVS) makes it possible to
return complex types without typecode, but probably in
a limited set of cases only, and it probably
breaks something somewhere else. But it worked
for me so far.

Discussion

  • Thomas Jacob
    Thomas Jacob
    2006-07-14

    Patch against latest SVN

     
  • Thomas Jacob
    Thomas Jacob
    2006-07-14

    Logged In: YES
    user_id=1011942

    Example:

    Instead of

    def service_func(param1, param2):
    # do something
    res = service_funcResponse()
    res.Person = res.new_Person()
    res.Person.Name = "John Doe"
    res.Person.Age = 14
    return res

    the patch allows this

    def service_func(param1, param2):
    # do something
    return { 'Person' :
    { 'Name' : 'John Doe', 'Age' : 14 }
    }