tags:

views:

58

answers:

0

I want to receive XML in this format using Soaplib:

<container>
    <item>
        <var1>foo</var1>
        <var2>foo</var2>
        <var3>foo</var3>
    </item>

    <item>
        <var1>foo</var1>
        <var2>foo</var2>
        <var3>foo</var3>
    </item>

    <item>
        <var1>foo</var1>
        <var2>foo</var2>
        <var3>foo</var3>
    </item>
</container>

My classes look like this:

class itemClass(ClassSerializer):
    class types:
        var1 = String
        var2 = String
        var3 = String

class containerClass(ClassSerializer):
    class types:
        item = Array(itemClass)

and my function call looks like this:

@soapmethod(containerClass, _returns=String)
def SOAPFunction(self, container):
    pass

I will receive a variable amount of <item> elements. If I send one <item> element and remove the Array() from the containerClass it works fine. I feel like I'm close, but just missing something.