'Get a list of I{parameter definitions} (pdef) defined for the specified method.
Each I{pdef} is a tuple (I{name}, L{xsd.sxbase.SchemaObject})
@param method: A service method.
@type method: I{service.Method}
@param input: Defines input/output message.
@type input: boolean
@return:  A list of parameter definitions
@rtype: [I{pdef},]'

def headpart_types(self, method, input=True):

    result = []
    if input:
        headers = method.soap.input.headers
    else:
        headers = method.soap.output.headers
    for header in headers:
        part = header.part
        if (part.element is not None):
            query = ElementQuery(part.element)
        else:
            query = TypeQuery(part.type)
        pt = query.execute(self.schema())
        if (pt is None):
            raise TypeNotFound(query.ref)
        if (part.type is not None):
            pt = PartElement(part.name, pt)
        if input:
            if (pt.name is None):
                result.append((part.name, pt))
            else:
                result.append((pt.name, pt))
        else:
            result.append(pt)
    return result
