def end(self, parent, content): # # For soap encoded arrays, the soapenc:arrayType attribute is # added with proper type and size information. # Eg: soapenc:arrayType="xs:int[3]" # Literal.end(self, parent, content) if content.aty is None: return tag, aty = content.aty ns0 = ("at0", aty[1]) ns1 = ("at1", "http://schemas.xmlsoap.org/soap/encoding/") array = content.value.item child = parent.getChild(tag) child.addPrefix(ns0[0], ns0[1]) child.addPrefix(ns1[0], ns1[1]) name = "%s:arrayType" % ns1[0] value = "%s:%s[%d]" % (ns0[0], aty[0], len(array)) child.set(name, value)
def start(self, content): # # For soap encoded arrays, the 'aty' (array type) information # is extracted and added to the 'content'. Then, the content.value # is replaced with an object containing an 'item=[]' attribute # containing values that are 'typed' suds objects. # start = Literal.start(self, content) if start and isinstance(content.value, (list, tuple)): resolved = content.type.resolve() for c in resolved: if hasattr(c[0], "aty"): content.aty = (content.tag, c[0].aty) self.cast(content) break return start