def node(self, content): # # Create an XML node and namespace qualify as defined # by the schema (elementFormDefault). # ns = content.type.namespace() if content.type.form_qualified: node = Element(content.tag, ns=ns) node.addPrefix(ns[0], ns[1]) else: node = Element(content.tag) self.encode(node, content) log.debug('created - node:\n%s', node) return node
def envelope(self, header, body): """ Build the B{<Envelope/>} for an soap outbound message. @param header: The soap message B{header}. @type header: L{Element} @param body: The soap message B{body}. @type body: L{Element} @return: The soap envelope containing the body and header. @rtype: L{Element} """ env = Element('Envelope', ns=envns) env.addPrefix(Namespace.xsins[0], Namespace.xsins[1]) env.append(header) env.append(body) return env