'set (wrapped|bare) flag on messages'

def set_wrapped(self):

    for b in self.bindings.values():
        for op in b.operations.values():
            for body in (op.soap.input.body, op.soap.output.body):
                body.wrapped = False
                if (len(body.parts) != 1):
                    continue
                for p in body.parts:
                    if (p.element is None):
                        continue
                    query = ElementQuery(p.element)
                    pt = query.execute(self.schema)
                    if (pt is None):
                        raise TypeNotFound(query.ref)
                    resolved = pt.resolve()
                    if resolved.builtin():
                        continue
                    body.wrapped = True
