'Resolve soap body I{message} parts by
cross-referencing with operation defined in port type.
@param definitions: A definitions object.
@type definitions: L{Definitions}
@param op: An I{operation} object.
@type op: I{operation}'

def resolvesoapbody(self, definitions, op):

    ptop = self.type.operation(op.name)
    if (ptop is None):
        raise Exception, ("operation    '%s'    not    defined    in    portType" % op.name)
    soap = op.soap
    parts = soap.input.body.parts
    if len(parts):
        pts = []
        for p in ptop.input.parts:
            if (p.name in parts):
                pts.append(p)
        soap.input.body.parts = pts
    else:
        soap.input.body.parts = ptop.input.parts
    parts = soap.output.body.parts
    if len(parts):
        pts = []
        for p in ptop.output.parts:
            if (p.name in parts):
                pts.append(p)
        soap.output.body.parts = pts
    else:
        soap.output.body.parts = ptop.output.parts
